Forum Discussion
I have only this xml response :smileysad: without any CDATA
And in the response window i have only one inset - "XML"
- PaulMS8 years agoSuper Contributor
If you renamed the test step then you need to update this line in the script
def holder = groovyUtils.getXmlHolder( "JDBC Request#ResponseAsXml" )
- Radford8 years agoSuper Contributor
I'm not sure why you script assertion is not working, but a couple of pointers:
1) Does your JDBC test step have a "JDBC Status" assertion? Probably not relavent but I always like to have one first just to give me confidence that there was nothing wrong with the SQL call.
2) An alternative to using the XML holder would be the following code, which may be worth trying to help track down your error :
def s = context.expand( '${JDBC Request#ResponseAsXml#//Results[1]/ResultSet[1]/Row[1]/PS_SUBSCRIBE_DATA_290.CREATED_DATE[1]}' ) log.info(s) assert s
One important point to note is that if the XML element does not exist, the context.expand will return an empty string, thus the assertion uses the fact that Groovy Truth will mean that both null and empty strings will assert to false.
Related Content
- 3 years ago
Recent Discussions
- 5 days ago
- 10 days ago