Default language.

Data Reference – Source Reference


The Data Reference <DataReference> element is used to reference data from a Referenceable element earlier in a Total Test Scenario. At runtime, it will replace itself with the referenced data. It can reference simple values as well as complex structures.

Syntax

The syntax of the Data Reference element is:

<DataReference referencedId="<id>" path="<Path to data>" />
  • referencedId: The ID from, for example, a SQLSelect, Component or Variable to which the element should refer.
  • path: A data path (as described in the introduction to the section) that specifies the data item or the data items in referenced element that should be extracted at runtime

Example

The first example references a single value in the variable and the Log element will output b2.

<Variable id="var1">
<A><B>b1</B></A>
<A><B>b2</B></A>
<A><C>b3</C></A>
</Variable>
<Log>
<data:Replaceable>
<DataReference referencedId="var1" path="/A[1]/B[0]/*" />
</data:Replaceable>
</Log>

The second example references all B data items in the variable and the Log element will output three B data items.

<Variable id="var1">
<A><B>b1</B></A>
<A><B>b2</B></A>
<A><C>b3</C></A>
</Variable>
<Log>
<data:Replaceable>
<DataReference referencedId="var1" path="/A/B" />
</data:Replaceable>
</Log>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*