After you add a Copybook schema to HCL OneTest™ API,
you can apply the schema to messages in applicable test actions.
About this task
The following example uses the sample Calculator project
and a Send Request action. You can apply the
same steps to a Receive Reply action to apply
validation options. For more information about messages, schemas,
and validation, see API Tester Reference.
Procedure
Create an empty test.
Add a Send Request action
to the Test Steps phase of the test. A Receive
Reply action is also created automatically.
Open the Send Request action
for editing.
For Message Type,
choose one of the following options:
Byte Array
To enter sample data in EBCDIC
Text
To enter sample data in ASCII
Select the data row and double-click
the Value column. Enter one of the following strings:
F1F0F0F0F0F0F0F0F0F2F3
If the Message Type is Byte
Array
10000000023
If the Message Type is Text
This
string represents compressed data that has not yet been formatted
by a copybook.
Right-click the data element
and select Schema.
In the Schema Selector window, Schema
Type field, select Mainframe > COBOL Copybooks and select the
schema that you imported into the HCL OneTest™ API Schema Library.
In the pane below the Schema Type, select a copybook and
root.
This example uses a copybook with a PIC9(1) and a
PIC9(10) variable. A sample message is displayed.
In the Formatter Properties section,
select a value for the Encoding field.
In this example, the default values are acceptable for the other
fields.
Accept the default values for the Content Options section
and click OK.
Results
The schema is applied to the original message, expanding the data field
as defined in the schema.
What to do next
If you used the REDEFINES clause in the schema, the field
definitions in that clause are not enabled when you import the schema
into HCL OneTest™ API.