Share this page

# Read text from the terminal screen

There are several Vuser functions that RTE Vusers can use to read text from the terminal screen. You can use the following functions to check that the terminal emulator is responding correctly, or to enhance the logic in your scripts:

- TE_find_text
- TE_get_text_line

For details on the syntax of these functions, see the Function Reference.

After recording, you can manually insert TE_find_text and TE_get_text_line statements directly into your RTE Vuser scripts.

### Searching for text on the screen

The TE_find_text function searches for a line of text on the screen. The syntax of the function is:

`int TE_find_text (char *pattern, int col1, int row1, int col2, int row2, int *retcol, int *retrow, char *match );`

This function searches for text matching pattern within the rectangle defined by col1, row1, col2, row2. Text matching the pattern is returned to match, and the actual row and column position is returned to retcol and retrow. The search begins in the top-left corner. If more than one string matches pattern, the one closest to the top-left corner is returned.

The pattern can include a regular expression. See the Function Reference for details on using regular expressions.

### Reading text from the screen

The TE_get_text_line function reads a line of text from the area of the screen that you designate. The syntax of the function is:

`char *TE_get_text_line (int col, int row, int width, char * text );`

This function copies a line of text from the terminal screen to a buffer text. The first character in the line is defined by col, row. The column coordinate of the last character in the line is indicated by width. The text from the screen is returned to the buffer text. If the line contains tabs or spaces, the equivalent number of spaces is returned.

In addition, the TE_get_cursor_position function can be used to retrieve the current position of the cursor on the terminal screen. The TE_get_line_attribute function returns the character formatting (for instance, bold or underline) of a line of text.

https://admhelp.microfocus.com VuGen,Professional Performance Engineering,Performance Engineering for Developers 8942
Tips to improve your search results... OpenText™ Virtual User Generator Help Center OpenText™ VuGen Help 26.1-26.3 All View Local Help Center View Online Help Center Version: