Property Transfer with xpath of element based on child element
Hi, I'm attempting a property transfer in SoapUI NG, based on the XPath however it is not working for me.
Taking this example response:
<e>
<id>f34f9f76-a4d9-412d-8407-f08299595f2a</id>
<name>IronMan</name>
<rank>1</rank>
</e>
<e>
<id>a97f6768-d087-4993-9a48-1a20ae23d27f</id>
<name>Thor</name>
<rank>2</rank>
</e>
<e>
<id>a0cf6c6e-31e3-4f28-98ec-33ae0d665e5d</id>
<name>Hulk</name>
<rank>3</rank>
</e>
If I use the "Get Data" Wizard to build my xpath from the ResponseAsXml, and grab the ID for Hulk, I get this and it works:
//*:e[3]/*:id[1]
However I am not always guaranteed that it will be the third "e" element, so when I attempt to grab it based on the name, such as:
//*:e[name='Hulk]/*:id[1]
It fails and returns null far as I know this should be the correct syntax, I have also tried:
//*:e[name[text()='Hulk]]/*:id[1]
//*:e[/name[text()='Hulk]]/*:id[1]
//*:e[/name='Hulk']/*:id[1]
etc. Any help would be appreciated.
- Of course, every one has choice to choose different ways. Completely understand when it comes to comfortability.
- I believe, we don't just stop there when hit a hard wall and keep going.
- If you are ok with xpath as shown in the picture and having hard time, hope below xpath expression helps: