Input tab

With the Input tab, you can configure a guard condition or specify incoming message field actions for each event.

For example, if you have created a basic (hard-coded) stubs from recorded events (see Creating basic stubs), the stub will filter out any messages that do not match exactly the message(s) received while recording the events used to build the stub, so the stub will not send a response message.

However, if you want that basic stub to respond to any messages that match the message structure in the stub irrespective of the values within the fields of those messages, you can use the Input tab to disable any filtering that checks for exact field matches and thus make your stub more versatile.

The page includes option buttons for specifying and configuring a guard condition for a event, and two windows for setting incoming message field actions for a event.
Tip: To search in the input tab, use the short cut key Ctrl+F.

Guard conditions

HCL OneTest API tags can be used to create guard conditions. For information about creating and using tags, refer to the HCL OneTest API reference.

If the Expression option is clicked in the Guard list in the list table on the upper-half of the Events tab, a collapsible Guard list, a text box, and a button are displayed on the Input tab. The controls enable you to create and test your own Boolean expressions.

The Guard list consists of the following scripting language options:
The default method for creating expressions. JavaScript is the most common type of ECMAScript.
Built-in or custom functions from HCL OneTest™ API version 5 and earlier. See Extending HCL OneTest API functionality using custom functions.

Clicking ECMAScript in the Guard list displays a Test button. Clicking Test validates your custom Boolean expression and displays an Output window that lists any errors.

Alternatively, clicking Legacy in the Guard list displays Add, Delete, and Test buttons and an ‘OR’ Expressions check box. Clicking Add makes the text box available and clicking Test validates your custom Boolean expression and displays an Output window that lists any errors. If a custom Boolean expression is entered, the starting characters of the expression will be displayed under Guard on the list table for the currently selected event.

For information about using ECMAScript, see Scripts within tests and stubs.

Incoming message field actions

The Message Header and Message Body windows on the Input page on the Events page enable you to specify actions for each field in the incoming message.

Expand or collapse the header by clicking Request Header. The header is collapsed by default.

Double-clicking any field in the Header or the Body opens the Field Editor dialog. The Action column is a single view of the action groups (Filter, Validate, and Store) for incoming messages.

A toolbar is available for the Message Body with the following options:
  • Expand Selection
  • Collapse Selection
  • Previous Interesting Node
  • Next Interesting Node
  • Open the tag data store

For example, if you want to disable any filtering for exact field matches:

  1. Select all of the fields on the Input tab.
  2. Right-click the selected fields and click Contents > Field Actions > Filter > Equality on the shortcut menus.

    Equality checking for the selected fields is disabled and fewer filter icons are displayed on the Input tab.

  3. Double-clicking a field opens the Field Editor dialog box. For more information, see The Field Editor.