Read Records – Source Reference
The Read Records <ReadRemoteFile> element is used to read a number of records from a data set. Into a test scenario. The records are then available to be used and referred to in the test scenario. The record layout must be defined as a MDataDefinition in the Total Test Scenario and referred to by the Read Records element.
Syntax
The syntax of the element is:
label="<label>"
firstRecord="1"
numberRecords="30"
mDataDefinitionName="<recordLayout>î />
The filename attribute specifies the full name of the data set to read. The ID attribute declares the ID which can be used to refer to the data later in the test scenario. The firstRecord attribute specifies which record should be read first, and the numberRecords specifies the maximum number of records to read. Finally the mDataDefinitionName specifies the name of the MDataDefinition in the Total Test Scenario that declares the record layout of the data set.
Example
Below shows an example where a record is read. The record contains information about cars.
firstRecord="1"
numberRecords="30"
mDataDefinitionName="record
layout" />
The recordLayout is defined in the Total Test Scenario and is:
<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>
This will read up to the first 30 records and provide the data in the format corresponding to the MDataDefinition including packed and numeric fields.