Forum Discussion
JHunt
Community Hero
Hi,
I think you are running this as a separate Groovy Script test step, but the script I posted was intended to be used as an assertion.
Go to your Test Request and choose add assertion, and the type is Script Assertion.
You can use my script exactly as is - you don't need to worry about XML vs JSON. The script gets the JSON response converted to XML: getResponseContentAsXml()
When I tested it against the JSON response, it showed the assertion as passed.
nkpalli
7 years agoContributor
Yeah..I was adding separate groovy script ..
Now i tried your way and i get this error :
net.sf.saxon.trans.XPathException: XPath syntax error at char 15 on line 2 in {\ncount(//*:data//*:}: Whitespace and comments are not allowed after '*:'
Related Content
- 3 years ago
- 5 years ago
Recent Discussions
- 15 years ago