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".
本文标签:
版权声明:本文标题:java - In readyApi can we dynamically update expected result of a Xquery Match Assertion using Script - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736306726a1933062.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论