cancel
Showing results for 
Search instead for 
Did you mean: 

Insert node with xQuery in Property Transfer

Highlighted
Occasional Contributor

Insert node with xQuery in Property Transfer

Hello, I'm new to xQuery/xPath and I'll manipulate a request.

I would like to insert informations from a datasource and the response of the step before - but that's not the problem, the Problem is now to insert a node without overwriting the existing things.

example source:


 
 


result should look like the following


  c
  b
  a
    123
 



Is it possible to insert with a property transfer step and xQuery/xPath?

source in property transfer (xQuery):


{
for $z in //testText
return $z/text()
}


destination in property transfer (XPath):

//root

How do I have to define the xPath in the destination that node3 is added and not is overwritten?

result now is:


  123


thank you for help... 
2 REPLIES 2
Highlighted
Super Contributor

Re: Insert node with xQuery in Property Transfer

Hi!

hmm.. I can come up with the following "solution";

1) Set the target of your property-transfer to a temporary property in your TestCase
2) "use" that property in your request via property-expansion.. ie if you call the property "tempXml" your request-xml would be


 
 
  ${#TestCase#tempXml}


Obviously this a  work-around that will only work in certain situations, a better fix would be for us to add a "append" option in the property-transfer that would append source nodes to target node.. or?

regards!

/Ole
eviware.com
Highlighted
Occasional Contributor

Re: Insert node with xQuery in Property Transfer

Hi

yes, I've done it now with a temporary property.

and yes, I think such an "append" in the property-transfer would be a great idea! then we could insert/append nodes very easy!

thanks!

regards!
iwan
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors