admin管理员组

文章数量:1122791

In my response I have a tag which is a ID and gets updated depending on the changes we did for a template. Its a value lets say "test1" which got update to "test2" and my Xquery Match assertion gets failed due to this and I have to go and manually update this from the current response. Can we have a script to dynamically update the expected result?

I wrote a script to get the current ID from the response but not sure how to update this in the Xquery Match Asseration.

I am able to get the current id from response:

def responseXml = context.expand('${testcasename#Response}')
log.info responseXml
def Envelope=new XmlSlurper().parseText(messageExchange.response.responseContent)
def response = context.expand( '${SC01_R1#Response#declare namespace response)
def ruleidentifier = context.expand( '${SC01_R1#Response#declare id)

trying to Fetch the XQuery Assertion from the test step:

/def testStep = testRunner.testCase.getTestStepByName('testname')

but it says "testRunner not found".

本文标签: