Adding .NET objects in messages

When your .exe or .dll file is added to HCL OneTest™ API, it can be applied as a schema to messages in applicable test actions.

Procedure

  1. Create a test in an operation that contains a reference to your JMS provider.
  2. Add a Send Request action to the Test Steps phase of the test. A Receive Reply action is also created.
    Both Send Request and Receive Reply actions are shown
  3. Double-click the Send Request action to open it for editing.
  4. Select your JMS-based transport and formatter, and select Bytes Message from the Message Type menu (above the message body).
    The Bytes Message type is set.
  5. In the message area, right-click the data (ByteArray) element and select Schema from the menu.
  6. In the Schema Selector window, Schema Type field, click Objects > .NET Objects.
  7. In the pane below the Schema Type, select the schema and root to apply to the message.
  8. No Formatter Properties are used with .NET objects.
  9. In the Content Options section, select or clear the following options as needed:
    Retain existing content
    Select this option to apply a schema or expand a field without losing the original data. If the attempt to use the original data fails, the data is displayed with red Xs. If you clear this option, data is cleared before the new schema is applied. In cases where the data is assumed to be retained, this option is not displayed.
    Include Text nodes
    Select this option to generate Text nodes with the message.
    Include optional nodes
    If the schema includes optional fields, select this option to add them to the message.
    Before HCL OneTest API version 8.7, additional options were displayed when you applied a schema to a message:
    • Accept fields in any order
    • Ignore missing fields in received message
    • Ignore additional fields in received message
    • Enable validation of time-based fields

    These options can be set in the project preferences. Click Project > Preferences > Message.

  10. The schema is applied to the original message, and the serializable classes that are defined in the assembly file are displayed as message fields.
    The revised message
  11. The same steps can be carried out in the Receive Reply action to apply validation options.
Feedback