Forum Discussion

Vipin_TV's avatar
Vipin_TV
Occasional Contributor
17 years ago

Property Transfer based on a particular value.

Hi,

I have a response as below and would like to do a Property Transfer of the "ResultKey" of the node which has the "ResultSource" as ProductionSource.
Please help me on this.


 
     
       
           
              123
              Result-123
              12345678
              DesignSource
              Default
           

           
              345
              Result-345
              12345678444
              ProductionSource
              Done
           

       

     

 


Thanks in advance.
Vipin.

12 Replies

  • Hi,

    A better solution would be this:


    def groovyUtils = new com.eviware.soapui.support.GroovyUtils( context )
    def holder = groovyUtils.getXmlHolder( "Navigate01 - Start#Response" )

    holder.namespaces["ns"] = "http://www.mywebsite.org/Apps/V3/XMLSchema"
    def resultServerItemIdFor2004 = holder["//ns:NavigationItem[ns:Text/text()='2004']/ns:ServerItemId/text()"]


    Regards,
    Dain
    eviware support
  • AutUser's avatar
    AutUser
    Occasional Contributor
    Hi Dain,

    Thanks a lot, I tried it and it worked just fine. Amazing. thanks for your support.

    I developed an alternative solution using XmlSlurper from Groovy and it worked
    as well just fine, but hey, I now have 2 different approaches.

    Thanks again!
    Igor