Reputation: 41
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xxx="http://xxx.call/">
<soapenv:Header/>
<soapenv:Body>
<cotf:call_XXX>
<!--Optional:-->
<arg0>
<!--Optional:-->
<parameter1>some value1</parameter1>
<!--Optional:-->
<parameter2>some value2</parameter2>
<!--Optional:-->
<parameter3>some value3</parameter3>
</arg0>
</cotf:call_XXX>
</soapenv:Body>
</soapenv:Envelope>
What I would like to know is how I can pass a variable instead of some value1,some value2,some value3 and how can I set these variable values from a response of another webservice
Thanks
Upvotes: 1
Views: 23093
Reputation: 18507
You could achieved this using properties, there are some scopes for the properties project, testCase, testSuite, etc. You've to set the property name and the value at desired scope and then you can use it directly in your request using the follow notation ${#scope#propertyname}
for example if you've a property called parameter1
at testCase scope, you can use it in your request as follows:
...
<arg0>
<!--Optional:-->
<parameter1>${#TestCase#parameter1}</parameter1>
...
For more info take a look at the documentation.
As you also ask to fill this property from the response of other testStep a possible way to achieved is using property transfer step, at this step you've to set:
XPATH
to perform against the source to get the value.I expand the second part with an example, so imagine you've a testStep which has myRequest
as name and its responds looks like:
<myResponse>
<someValue>MyValue</someValue>
<anotherText>someText</anotherText>
</myResponse>
You want to get the value of <anotherText>
node to reuse it so the XPath
to get it from the response //*:anotherText
. Then you put the value inside a property called parameter1
at TestCase
level (i.e the testCase is named TestCase 1
). In this scenario the property transfer step will be:
myRequest
Property: Response
//*:anotherText
TestCase 1
Property: parameter1
For more info take a look at the documentation here and here
Hope it helps,
Upvotes: 3