To perform a manual check to identify a screen requires that the host application screens have static text at certain locations on the screen. An example of this would be to use the screen title. The HostScreen.getText method provides the functionality required to retrieve text from specific locations on a screen.
It is good practice to check for the existence of more that one set of text to identify a screen. Checking the cursor location can also be used to assist in identifying a screen, and is very useful in a character-based VT environment. Checking the cursor location is usually used to supplement the checking for text.
The following code demonstrates how to identify the first two screens in the Insure script.
Once the connection has been made, the getText method is used to retrieve text from row 10, column 3. This is compared against the text expected at that location, namely "SWITCHIT". A check is also made for the text "ENTER" at row 23, column 2. If both these sets of text exist at those locations then it the screen must be the expected starting screen. A message is displayed, the keys "simmy" sent to host screen and the enter action executed.
The next screen is checked for the text "*Info Access Direct*" at row 2, column 27; and "ENTER" at row 23, column 2. If the text is found then the expected screen is active and another message is displayed.