Contributions
Re: Property Transfer with xpath of element based on child element
Thanks for the response and info, its good to know the options :) CurrentlyI am doing similar processing from my java code already so I think I'm good there for now, working with any full language its fairly easy. I still think there is a bug here that would be nice to get fixed, would come in handy, and make some things easier. See the example screenshot, where I have a property transfer test step, I used the xpath builder to generate the xpath, then I replaced the "e[1]" (hardcoded index) with a valid xpath expression, "e[name='test2']" When the soap response has no namespace this works fine, when there is one you get null every time.8 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.3KViews0likes2CommentsRe: Property Transfer with xpath of element based on child element
So after some more work I ended up doing the parsing for thedata I need with Java instead of using the property transfer. In my setup I am using the soapUI test as library calls from my java code. After some troubleshooting I started having similar issues in java for some responses and not others, and it turned to our to be my name space aware setting, and it looks like ReadyApi SoapNG has the same issue. So basically, my response above had a namespace in it like this, (which i didn't post in my original post as I thought it was irrelevant) <Response xmlns="http://someUrl"> <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> </Response> In Java DocumentBuildFactory, when I set Name Space Aware to false, everything started working. So I tested this in ReadyAPI and it has the same issue. Basically if I take a soap response that has no namespace (xmlns) value in then the data transfer works fine when I do something like, it gets the correct value: //*:e[name='Hulk]/*:id[1] However if the response has a namespace value, then it returns null. Is there a way around this or is this a bug?8 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.3KViews0likes4CommentsProperty 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 exampleresponse: <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 beappreciated.Solved8 years agoPlace ReadyAPI QuestionsReadyAPI Questions5.4KViews0likes5Comments