Recognition Rules for VT Hosts

Recognition rules are unique expressions used by Task Builder to identify and match a host screen with its associated task step. As you record a task, a recognition rule is generated for each step in that task. Using those recognition rules, Task Builder compares the recorded step location with the host screen to verify that each recorded task step matches its correct host screen.

In VT, as opposed to other host types, data is sent in a continuous, two-way stream, containing both text and escape sequences. Network traffic and latency can also influence how data packets are received from the host. This makes it not only difficult to recognize when the host is done sending data, but also to recognize screens and to navigate the host application.

Because of the unstructured nature of VT host interaction, VT tasks are always created using a transient step as an intermediate step between two settled steps. This gives more flexiblity to the navigation engine since, during run-time, the settled steps will attempt a match after each block of data is received. Due to this functionality, step recognition rules are very important when interacting with a VT host.

With other host types Task Builder matches a certain host field on the screen to a particular line of text. For example, HostField2 like '*Welcome to*' and HostField12 like 'Login:*'. Because there are no host fields in VT, additional methods are available to help you write effective recognition rules to successfully match VT host screens.

These are:

Note Although matching screens based on the last text received from the host is fairly reliable in determining when a screen has settled, it may not help when attempting to branch between two similar screens. For example, in a situation where the host application contains separate distinct screens that always send the same text at the end (perhaps a user prompt), you could use user fields and cursor position matching to make your recognition rules more explicit.

Using recognition rules with automatically formatted VT screens

You can use automatic formatting to have Task Builder automatically create user fields on your task steps while recording. When using automatic formatting, as you record your task, Task Builder uses user fields to automatically create a recognition rule for each task step. On the Recordings page, you can modify the default settings used to create these rules to more accurately and easily match your VT host screens. These settings modify the task step recognition rule, not the recorded task itself.

For more information on how automatic fields are created and defined, see Automatically Adding User Fields to VT Screens.

Recognition rules and task failures

Tasks occasionally fail during testing. The Task Failure Information dialog box tells you which task steps failed. The information includes recognition rule failure, cursor position, and the last text received from the host.

When a task fails and arrives at an unrecognized screen or navigation error, choose More Info from the Unrecognized Screen or Navigation Error message box to troubleshoot your task data.

The Task Failure Information dialog box provides:

Breaking apart a failed recognition rule

The Task Failure Information dialog box contains a tree view representation of the recognition rule for each unmatched task step. This tree view provides a broken-out version of the expression, detailing which part of the recognition rule failed.

With this diagnostic tool you should be able to determine where your task failed and then, using the Recognition Rule Editor in Task Builder, modify the rule and retest.

Related Topics
Bullet Modifying Screen Recognition Rules, Overview
Bullet Modifying Screen Recognition Rules
Bullet Defining Rules with Expressions
Bullet Using Functions to Create Expressions
Bullet Automatically Adding User Fields to VT Screens
  Attachmate