How to change data source values in xml-request before sending?
In SOATest I have a SOAP-test that takes its values from a data source (an Excel-file). How can I change specific values in the request based on values from the data source?
Example:
The field "CustomerID" needs to have either a random UUID-value or a specific UUID-value. In the Excel-file the field value is set to "Auto" in the cases where a random value is needed and to the specific value when that is needed.
I have a Jython-script to generate UUIDs, but I need a way to use that script when the value "Auto" is encountered.
Best Answer
-
Solved.
I use a field script that takes a single parameter (context) and from that I can get the value from the datasource with value = context.getValue("data source", "column name").
Based on the value, the function can return the desired output which will then be put into the field.
1