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 months ago
Recent Discussions
- 3 hours ago
- 4 days ago
xml to soap
Solved4 days ago- 4 days ago