Forum Discussion
- nmrao
Champion Level 2
You mean in the groovy?
for eg:def list = [1,2,3,4]
def expectedSize = 4
assert list.size == expectedSize
Is this something you looking for? - gmanoj77Occasional Contributoryes in Groovy, but bit for dynamic which can parse the response.
- Cizo89Frequent ContributorHi,
this should give you the idea:
String xml = '''<a>
<b>b1</b>
<b>b2</b>
<b>b3</b>
<b>b4</b>
</a>'''
def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context)
def holder = groovyUtils.getXmlHolder(xml)
Integer expectedSize = 4
assert holder.getNodeValues("//a/b").size() == expectedSize
/*
To get whole Response of your requested step, use this:
def holder = groovyUtils.getXmlHolder("Your_Test_StepT#ResponseAsXml")
*/
Regards,
Marek - gmanoj77Occasional Contributorthis worked except had to change to
def holder = groovyUtils.getXmlHolder("Your_Test_StepT#Response")