How to Assign Values to XML Elements

  • KM00553748
  • 09-Sep-2013
  • 19-Sep-2013

Summary

How to Assign Values to XML Elements

Question

How to Assign Values to XML Elements?

Answer

This task describes how to work with XML elements by manually editing the code, importing an
external file, and exporting the XML for later use.

1. Prerequisites:
Import a service and create a new Web Service call. Alternatively, in the Step Navigator, right click a step and select Show Arguments.

2. Select the element:
In the left pane, select a complex type or array argument. In the right pane, click XML. The XML field shows the XML code as a single string.

3. Import a file - optional:
To import a previously saved XML file, click Import and specify the file's location.

4. Edit the XML elements - optional:
To edit the XML structure and element values, click Edit. The XML Editor opens. To import a previously saved XML file, click Import File.
- To manually edit the code, click the Text View tab.
- To modify the XML through a graphical interface, click the Step Navigator. Use the shortcut menu to add children and sibling elements and rename the node. Click Insert from the shortcut menu to add a new element before or after the selected one.

5. Export a file - optional:
To save your XML data to a file so it can be used for other tests, click Export and specify a location.