Forum Discussion

bujji7ram's avatar
15 years ago

How to get the particular node value of the xml response???

How to get the particular node value of the xml response???

How to get the particular node value of the xml response, when when its iterate more than one time and I need to capture the node value in the response for every iteration?

In response
eg: 1234

Ist iteration - 12345
2nd iteration - 23456
3rd iteration - 34567


Thanks in advance

4 Replies

  • kishore_konka's avatar
    kishore_konka
    Occasional Contributor
    If U could see the responce XML in tools Outline view, U can add ""transfer to " or "Add assertion" to get node value
  • mandadavenkat's avatar
    mandadavenkat
    Occasional Contributor
    Try this and if your node is unique through out the response remove the loop

    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )

    def holder = groovyUtils.getXmlHolder( "<TestStepName>#Response" )

    def items = holder.getNodeValues( "//ID")
    log.info( "Found " + items.length + " items.." )
    for (item in items)
    {
    log.info( item )
    }