Forum Discussion
Hi Rup,
When I say names more than 500 it means the count of names,I have more than 500 blocks or chunks of names to be extracted.
Still I have not got there yet I am first trying to extract the data from the CData
But encountering the following message.
groovy.lang.MissingPropertyException: No Such Property: messageExchange for class: Script8 error at line 3
import com.eviware.soapui.support.XmlHolder respXmlHolder = new xmlHolder(messageExchange.getResponseContentAsXml()) respXmlHolder.declareNamespace("ns1","http://tempuri.org/") CDATAXml = respXmlHolder.getNodeValue("//ns1:Result") log.info(CDATAXml)
Please let me know where I am going wrong. Are there any links for the same where I can get some assistance in debugging such errors.
Thanks,
SD
Hi SD,
Ok, so basically if the count of those Report JSON documents goes above 500, then we capture 501+ etc.
OK, maybe we should work on it a step at a time.
1) First we can try to extract the report JSON documents from the response CDATA.
2) Then, we can use JSON Slurper to parse the JSON data into report objects.
3) Then we can try to extract just the report objects where the count is >500
In terms of the error you're getting, at first glance it looks like you're not running the script from a Script Assertion? The messsageExchange variable is only available to script run there:
- rupert_anderson9 years agoValued Contributor
Thats a nice JSON Slurper script example that Rao has provided, that should cover step 2 and part of step 3 :-)