Forum Discussion

JShah's avatar
JShah
Contributor
14 years ago

overwriting xml node element

Hi Guys,

Is there away we can overwrite xml node value before sending it to the rest request?

Sample: xml data from datasource - directory

<root>
<foo>value1</foo>
<bar>value2</bar>
</root>

so before sending it to the rest request xml will turn to

<root>
<foo>newvalue</foo>
<bar>value2</bar>
</root>

the new value will be generated from another datasource.

Test Suite Steps:

Datasource ( directory - xml files )
property transfer ( xml row pass to rest request )
rest request
data loop


Thanks in advance

1 Reply

  • Hi,

    sure, if I understand you correctly you can just add another Property Transfer after the one transferring the request body that inserts the desired value into the request XML.. ie the source would be the other datasource you mention and the target would be the same property you just wrote the request to, with corresponding XPath to insert at the right place...

    Does that make sense?

    regards,

    /Ole
    SmartBear Stockholm