...
Adding Regression Controls
You can add a regression control using the XPath values you extracted or altered. Right-click the SOAP Client node that contains an XML Transformer and select Create Regression Control from the shortcut menu. A Transformed XML> Diff node appears underneath the XML Transformer node. If you select this node, you will see the XPaths you added to the Selected XPaths list in the XML Transformer tool.
Parameterizing XPaths
You can parameterize XPaths to reference testtest reference test or Responder suiteResponder suite variables, environment variables, and data source values. The syntax to reference variables is ${myVariableName}. The syntax to reference XML Data Bank values and Data Source Values is: ${myColumnName}.
For example, if ${XPath Key} is a data source column name, you could use
/*[local-name(.)="bookstore" and namespace-uri(.)=""]/*[local-name(.)="book" and
namespace-uri(.)=""][child::node()[local-name(.)="title" and text()="${XPath Key}"]]
Handling Empty Elements to Maintain the Integrity of the XML Response
Anchor | ||||
---|---|---|---|---|
|
By default, empty elements will not be extracted. This could impact the integrity of the XML response for use in a Writable Data Source. For instance,
Code Block |
---|
<e>5</e> <e/> <e>6</e> |
Code Block |
---|
ROW 1 = 5 ROW 2 = 6 |
- Enable Extract empty elements as.
- (Optional) If you want a "placeholder" value to be added for every empty extracted element, indicate the desired placeholder string in the adjacent text field.
- Select one of the XPaths that specifies what to extract, then click Modify.
- Ensure that the Extract option is set to Content only.
Delete the
/text()
at the end of the related XPath(s) For example, if the current XPath isCode Block /*[local-name(.)="Envelope" and namespace-uri(.)="http://schemas.xmlsoap.org/soap/envelope/"]/.../*[local-name(.)="i" and namespace-uri(.)=""][1]/text()
Edit it to
Code Block /*[local-name(.)="Envelope" and namespace-uri(.)="http://schemas.xmlsoap.org/soap/envelope/"]/.../*[local-name(.)="i" and namespace-uri(.)=""][1]
- Repeat steps 3-5 for additional XPaths as needed.