Verify Dataset (Verify mode) – Source Reference


The Verify Dataset <VerifyRemoteFile> element can be used in two modes, a Compare mode and a Verify mode. In the Verify mode each record will be verified by verify expressions. It first declares which records should be verified, and it then declares the verification rules on field level.

Syntax

The syntax of the element is

<VerifyRemoteFile name="Verify remote file"
mode="VERIFY"
haltExecution="false"
mDataDefinition="recordlayout"
actualPath="XATESTER.TESTDATA.VERFILE2">
<Verifications>
  <Verification label="Verify">
<SelectionRules>
<Rule dataPath="<path>" operator="<operator>" value="<value>" />
</SelectionRules>
<VerifyRules>
<Rule dataPath="<path>" operator="<operator>" value="<value>" />
</VerifyRules>
</Verification>
  </Verifications>
</VerifyRemoteFile>

The mandatory actualPath attribute specifies which data set to be verified. The haltExecution attribute is false by default. The test scenario execution will stop when the haltExecution is true and the verification is not accepted. The mDataDefinition attribute defines the MDataDefinition in the Total Test Scenario to use as record layout. The MDataDefinition must match the record layout of the data set.
The Verifications element contains one or several verifications, each defined by a Verification element. A Verification element contains a number of selection rules, defined by Rule elements that specifies which records to be selected for verification. The VerifyRules element contains a number of verification rules, also defined by Rule elements that specifies rules that must be satisfied by the selected records.
A Verify Dataset can have multiple verifications and hence select different kinds of records and make different verification rules for each selection.
A Rule element is used to either select a record or to verify a record. Multiple rules can be defined together, and all rules must then be fulfilled to either select or successfully validate the records. The Rule has a dataPath attribute that points out the field in the record layout defined by the MDataDefinition to be checked. The dataPath has a structure similar to data paths used other places like the Data Reference element. The value attribute contains the value to be used in the rule and the operator attribute contains the operator to use for verifying the field value against the rule value. Following operators can be used:

  • GT : (Greater Than)
  • • LT : (Less Than)
  • • EQ : (Equal=)
  • • GTE : (Greater Than or Equal)
  • • LTE : (Less Than or Equal)
  • • NE : (Not Equal)
  • • BETWEEN : (Between to numbers separated by ,)
  • • IN : (Value in a sequence of values separated by ,)
  • LIKE : (Like a value)

Example

Below shows an example where a data set containing records of cars is verified. First all cars of ‘Audi’ are selected, and then each of these Audi records are verified to have horse powers greater than 300 and less than 600.

<VerifyRemoteFile name="Verify remote file" mode="VERIFY" haltExecution="false"
mDataDefinition="recordlayout"
actualPath="XATESTER.TESTDATA.VERFILE2">
<Verifications>
  <Verification label="Verify">
<SelectionRules>
<Rule dataPath="/XACARTEST/CARMAKER" operator="EQ" value="Audi" />
</SelectionRules>
<VerifyRules>
<Rule dataPath="/XACARTEST/BHP" operator="GT" value="200" />
<Rule dataPath="/XACARTEST/BHP" operator="LT" value="600" />
</VerifyRules>
 </Verification>
   </Verifications>
</VerifyRemoteFile>

For the above example, the referenced MDataDefinition called recordlayout is defined as shown:

<MDataDefinition name="recordlayout">
<XACARTEST native="01 XACARTEST.">
<CARID type="NumericBinary" length="9" bytes="4" signed="true" decimals="0" />
<MODELID type="NumericBinary" length="9" bytes="4" signed="true" decimals="0"/>
<CARMAKER type="Character" length="28" bytes="28" />
<MODELNAME type="Character" length="28" bytes="28" />
<PRICE type="NumericBinary" length="9" bytes="4" signed="true" decimals="0" />
<BHP type="NumericBinary" length="4" bytes="2" signed="true" decimals="0" />
<ACCEL type="NumericPacked" length="3" bytes="3" signed="true" decimals="2" />
<TOPSPEED type="NumericBinary" length="4" bytes="2" signed="true" decimals="0"/>
<TSTMP type="Character" length="26" bytes="26" />
<USER type="Character" length="8" bytes="8" />
<ROWSTATE type="Character" length="1" bytes="1" />
</XACARTEST>
</MDataDefinition>

 

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