Solved
Forum Discussion
Oct21
7 years agoOccasional Contributor
The script provided earlier was also used as a groovy test step, and the script am using now is also as a groovy test step.
You can check the screenshot i sent.
nmrao
7 years agoChampion Level 2
If you read the post again, it clearly says Scipt Assertion (for the same step where you get the response). No additional step. Please correct it and try again.
- Oct217 years agoOccasional Contributor
I tried to use the script as script assertion to the request where i am getting the response. But i am getting the same error.
Not sure what has changed, it is parsing the values but not able to pick the one which is described.
And the past script i used as a groovy script and worked perfectly.
Could please check and help me again. Check the screenshot.
Thanks again.
Regards,
Oct21
- nmrao7 years agoChampion Level 2
Oct21 ,
Here is the new script assertion for the attached xml
assert context.response def getData = { data, element -> new XmlSlurper().parseText(data).'**'.find {it.name() == element} } def receiptId = getData(context.response, 'ReceiptId') log.info receiptId context.testCase.setPropertyValue('ID', receiptId.toString())
Related Content
Recent Discussions
- 2 hours ago
- 2 days ago