Structure of XML TestCases

In order to build TestCases you will need the TBox XEngines Modules from the Standard subset.

XML business-based control types

The following table contains the business-based control types including their icons. Control types are highlighted in color in the illustration below (Test01.xml).

Business-based control types

Icon

Business-based control type

Business-based property

XML document

 

XML attribute (red)

Title

XML value (black)

Text

XML comment (green)

Text

XML declaration (yellow)

Encoding, Value

XML element (blue)

Namespace, Text

XML CDATA (orange)

Data

Example - Test01.xml

All elements listed in the table "Business-based control types" can be added, edited or verified.

  • Insert: adds new XML elements.

  • Input: modifies existing elements.

  • Verify: verifies values. Properties of control types are specified for editing in the Value column.

To enter special characters, strings specified for XML must be entered.

XML special characters

Special characters

Display

<

&lt;

>

&gt;

&

&amp;

Example - Editing elements

The following example illustrates various editing options with the XML Engine 3.0.

You can find detailed information on the next pages.

The XML file booksNew.xml is loaded into the resource editedXmlResource. The test configuration link {CP[ExampleDirectoryXML]} points to the path defined in the test configuration parameter ExampleDirectoryXML.

In the TestStep Edit some xml nodes, the value of the property Encoding is changed to UTF-16. Properties of control types to be used for editing are specified in the Value column.

A comment is added for the XML element Book. The element Author with the value Teacher is searched. The value of the element Price is set to 29.95 for exactly this Author.

The content of the resource editedXmlResource is saved as a new XML file booksEdited.xml to the path specified in the test configuration parameter ExampleDirectoryXML.

Editing XML elements