TeTextScreen Object

Description

A terminal emulator screen that uses text-only HLLAPI or does not support HLLAPI.

IMPORTANT

UFT One uses this object to identify elements in the terminal emulator screen as text on a specific location in the screen. It does not recognize fields.

Note: The recorded and smart description properties of the TeTextScreen object cannot be configured. This object is therefore not included in the Test Object classes list for the Terminal Emulators environment in the Object Identification dialog box. For details on the Object Identification dialog box, see the UFT One User Guide.

Operations

The sections below list the built-in methods and properties that you can use as operations for the TeTextScreen object.

Note: You can also view a list and descriptions of the TeTextScreen description properties, for use in object repository descriptions, programmatic descriptions, checkpoint and output value steps, and as argument values for the GetTOProperty and GetROProperty methods.

Methods

Common Method CaptureBitmapSaves a screen capture of the object as a .png or .bmp image using the specified file name.
Common Method CheckChecks whether the actual value of an item matches the expected value.
Common Method CheckPropertyChecks whether the actual value of the specified object property matches the specified expected value within the specified timeout.
Common Method ChildObjectsReturns the collection of child objects contained within the object.
Common Method GetAllROProperties

Returns the collection of properties and current values from the object in the application.

Method ClickClicks on a set of coordinates on the emulator screen.
Method ClickPositionClicks the specified row and column position on the emulator screen.
Method GetCursorPosReturns the position of the cursor in the emulator screen.
Common Method GetROPropertyReturns the current value of the description property from the object in the application.
Method GetTextReturns the text from the specified emulator screen rectangle.
Common Method GetTOPropertiesReturns the collection of properties and values used to identify the object.
Common Method GetTOPropertyReturns the value of the specified description property from the test object description.
Common Method HighlightHighlights the object in the application.
Common Method OutputRetrieves the current value of an item and stores it in a specified location.
Common Method RefreshObjectInstructs UFT One to re-identify the object in the application the next time a step refers to this object.
Method SendKeySends a keystroke or string of keystrokes to the current cursor position in the emulator screen.
Method SetCursorPosChanges the position of the cursor within the emulator screen.
Method SetTextCopies a string to a specific location in the emulator screen.
Common Method SetTOPropertySets the value of the specified description property in the test object description.
Method Sync

For tests, this method uses the Object Synchronization Timeout setting in the Run pane of the Test Settings dialog box if a value is not specified for the timeout.

For components, this method uses the default Object Synchronization Timeout setting if a value is not specified for the timeout.

Note: Neither the Active Screen nor the Run Results Viewer displays a screen capture for the Sync step.

Common Method ToStringReturns a string that represents the test object.
Method TypeTypes the specified string at the current location of the cursor.
Common Method WaitPropertyWaits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step.
Method WaitStringWaits for a specified string to appear on the emulator screen before continuing the run session.

Properties

Property ColumnCountReturns the total number of columns in the emulator screen.
Common Property ExistChecks whether the object currently exists in the open application.
Property RowCountReturns the total number of rows (lines) on the emulator screen.

Back to top

 

Click Method

Description

Clicks on a set of coordinates on the emulator screen.

Syntax

object.Click [X], [Y], [BUTTON]

Arguments

ParameterDescription
X Optional. An integer value.
The x-coordinate of the click.
Default value = -9999
Y Optional. An integer value.
The y-coordinate of the click.
Default value = -9999
BUTTON Optional. A predefined constant or number.
Indicates the mouse button to click.

Default value = micLeftBtn

Return Type

None

IMPORTANT

If no coordinates are specified, the default click will be at the center of the emulator text screen.

Note: This method is not recorded. To add this method to your test or component, use the Step Generator or enter it in the Keyword View or Editor. For more information on the Step Generator, the Keyword View, and the Editor, refer to the UFT One User Guide. When you click a location on your emulator text screen while recording, the ClickPosition method is recorded. For more information, see ClickPosition.

Example

Back to top

 

ClickPosition Method

Description

Clicks the specified row and column position on the emulator screen.

Syntax

object.ClickPosition Row, Column

Arguments

ParameterDescription
Row Required. A long integer value.
The row position where the click is performed. The first row in the screen is 1.
Column Required. A long integer value.
The column position where the click is performed. The first column in the screen is 1.

Return Type

None

IMPORTANT

While recording, UFT One records a ClickPosition statement whenever a click is performed, even if the cursor position does not change in the emulator screen. This has no impact on your run session.

Notes:

You can modify the Terminal Emulator Add-in configuration settings to prevent UFT One from recording ClickPosition statements.

In addition, if the coordinates recorded in the ClickPosition statements are not as you would expect, you can use the Terminal Emulator Configuration Wizard to adjust the UFT One screen calculation algorithm.

For more information, see the Terminal Emulator Add-in in the Add-ins section of the UFT One Help Center.

Example

Back to top

 

GetCursorPos Method

Description

Returns the position of the cursor in the emulator screen.

Syntax

object.GetCursorPos ScreenRow, ScreenCol

Arguments

ParameterDescription
ScreenRow Required. A Variant.
The retrieved row position of the cursor in the emulator screen. The first row in the screen is 1.
ScreenCol Required. A Variant.
The retrieved column position of the cursor in the emulator screen. The first column in the screen is 1.

Return Type

None

IMPORTANT

Typically, you use this function to ensure the cursor is at the correct location in the screen before sending data using the SendKey method. For more information, see SendKey.

Note: Use the GetCursorPos method only if your terminal emulator settings have been configured to fully support HLLAPI. If your emulator does not support the HLLAPI QueryCursorLocation function no. 7, you may receive unexpected results.

Example

Back to top

 

GetText Method

Description

Returns the text from the specified emulator screen rectangle.

Syntax

object.GetText ([TopRow], [LeftCol], [BottomRow], [RightCol])

Arguments

ParameterDescription
TopRow Optional. A long integer value.
The top coordinate of the rectangle. The first row in the screen is 1.
Default = 1

Default value = 0
LeftCol Optional. A long integer value.
The left coordinate of the rectangle. The first column in the screen is 1.
Default = 1

Default value = 0
BottomRow Optional. A long integer value.
The bottom coordinate of the rectangle.
Default = last row number

Default value = 0
RightCol Optional. A long integer value.
The right coordinate of the rectangle.
Default = last column number

Default value = 0

Return Type

A String value.

IMPORTANT

The rectangle is defined by pairs of coordinates that designate two diagonally opposite corners of the rectangle. To get the total number of rows and columns on the screen, use the RowCount and ColumnCount methods.

Example

Back to top

 

SendKey Method

Description

Sends a keystroke or string of keystrokes to the current cursor position in the emulator screen.

Syntax

object.SendKey Key

Arguments

ParameterDescription
Key Required. A String value.
UFT One sends the string of keystrokes to the host presentation space. The string can contain up to 255 characters. More than one character may be required to represent a keystroke. Some key strokes can also be represented using predefined keyboard mnemonics listed in the table below.

Note:
Not all terminal emulators support all keyboard mnemonics. For more information, see your emulator documentation.


Key
Mnemonic
Script Constant
@
@@
-
PA1
@x
TE_PA1
PA2
@y
TE_PA2
PA3
@z
TE_PA3
PA4
@+
TE_PA4
PA5
@%
TE_PA5
PA6
@&
TE_PA6
PA7
@'
TE_PA7
PA8
@(
TE_PA8
PA9
@)
TE_PA9
PA10
@*
TE_PA10
PF1
@1
TE_PF1
PF2
@2
TE_PF2
PF3
@3
TE_PF3
PF4
@4
TE_PF4
PF5
@5
TE_PF5
PF6
@6
TE_PF6
PF7
@7
TE_PF7
PF8
@8
TE_PF8
PF9
@9
TE_PF9
PF10
@a
TE_PF10
PF11
@b
TE_PF11
PF12
@c
TE_PF12
PF13
@d
TE_PF13
PF14
@e
TE_PF14
PF15
@f
TE_PF15
PF16
@g
TE_PF16
PF17
@h
TE_PF17
PF18
@i
TE_PF18
PF19
@j
TE_PF19
PF20
@k
TE_PF20
PF21
@l
TE_PF21
PF22
@m
TE_PF22
PF23
@n
TE_PF23
PF24
@o
TE_PF24
Alternate Cursor
@$
TE_ALTERNATE_CURSOR
Attention
@A@Q
TE_ATTENTION
Backspace
@<
TE_BACKSPACE
Backtab
@B
TE_BACKTAB
Clear
@C
TE_CLEAR
Cursor Down
@V
TE_DOWN
Cursor Left
@L
TE_LEFT
Cursor Right
@Z
TE_RIGHT
Cursor Select
@A@J
TE_CURSOR_SELECT
Cursor Up
@U
TE_UP
Delete Character
@D
TE_DELETE
Dup
@S@x
TE_DUP
Enter
@E
TE_ENTER
Erase EOF
@F
TE_ERASE_EOF
Erase Input
@A@F
TE_ERASE_INPUT
Field Exit
@A@E
TE_FIELD_EXIT
Field Mark
@S@y
TE_FIELD_MARK
Field Minus
@A@-
TE_FIELD_MINUS
Field Plus
@A@+
TE_FIELD_PLUS
Home
@0
TE_HOME
End
@q
TE_END
Insert Character
@I
TE_INSERT
New Line
@N
TE_NEW_LINE
Print Screen
@P
TE_LOCAL_PRINT
Page Down
@v
TE_PAGE_DOWN
Page Up
@u
TE_PAGE_UP
Reset
@R
TE_RESET
System Request
@A@H
TE_SYS_REQ
Tab
@T
TE_TAB
Help
@H
TE_HELP
¢ (cent)
@A@c
TE_TEST
| (solid vertical bar)
@A@v
-
Backward Word
@A@z
-
Card Reader
@W
-
Cursor Left Double
@A@L
-
Cursor Right Double
@A@Z
-
Device Cancel
@A@R
-
Magnetic Slot Reader
@Y
-
Forward Word
@A@y
-


Return Type

None

IMPORTANT

  • You can send data keys (for example, A, B, C) or attention identifier keys (for example, TE_ENTER or TE_PA1).

Note: Use the SendKey method only if your terminal emulator settings have been configured to fully support HLLAPI. If your emulator does not support the HLLAPI SendKey function no. 1, you may get unexpected results.

  • This method is not supported for Micro Focus Reflection Desktop for UNIX or OpenVMS.

Example

Back to top

 

SetCursorPos Method

Description

Changes the position of the cursor within the emulator screen.

Syntax

object.SetCursorPos ScreenRow, ScreenCol

Arguments

ParameterDescription
ScreenRow Required. A long integer value.
Row position where the cursor is placed in the emulator screen. The first row in the screen is 1. To get the total number of rows in the screen, use the RowCount method.
ScreenCol Required. A long integer value.
Column position where the cursor is placed in the emulator screen. The first column in the screen is 1. To get the total number of columns in the screen, use the ColumnCount method.

Return Type

None

IMPORTANT

  • Typically you use this method to place the cursor in the appropriate position before sending data using the SendKey method.

Note: Use the SetCursorPos method only if your terminal emulator settings have been configured to fully support HLLAPI. If your emulator does not support the HLLAPI SetCursor function no. 40, you may get unexpected results.

  • This method is not supported for Micro Focus Reflection Desktop for UNIX or OpenVMS.

Example

Back to top

 

SetText Method

Description

Copies a string to a specific location in the emulator screen.

Syntax

object.SetText ScreenRow, ScreenCol, Text

Arguments

ParameterDescription
ScreenRow Required. A long integer value.
Row position in the screen where you want to place the string. The first row in the screen is 1. To get the total number of rows in the screen, use the RowCount method.
ScreenCol Required. A long integer value.
Column position in the screen where you want to place the string. The first column in the screen is 1. To get the total number of columns in the screen, use the ColumnCount method.
Text Required. A String value.
The string that is copied to the screen.

Return Type

None

IMPORTANT

  • Use the SetText method only if your terminal emulator settings have been configured to fully support HLLAPI. If your emulator does not support the HLLAPI CopyStringtoPresentationSpace function no. 15, you may get unexpected results.
  • If the data string being copied extends beyond the end of the field to which it is being copied in a field-formatted presentation space, data will be truncated.
  • The string size cannot exceed the screen size.
  • The SetText method can be used to enter only printable characters, not keystrokes such as TE_ENTER. After using this method to copy printable characters to the emulator screen, you can use the  SendKey method to send TE_ENTER or another special key to the host.
  • This method does not change the location of the cursor.
  • You can use the GetCursorPos method to determine the position of the cursor in the emulator screen. You can then use that value as the position for the SetText method.
  • This method is not supported for Micro Focus Reflection Desktop for UNIX or OpenVMS.

Example

Back to top

 

Sync Method

Description

For tests, this method uses the Object Synchronization Timeout setting in the Run pane of the Test Settings dialog box if a value is not specified for the timeout.

For components, this method uses the default Object Synchronization Timeout setting if a value is not specified for the timeout.

Note: Neither the Active Screen nor the Run Results Viewer displays a screen capture for the Sync step.

Syntax

object.Sync [lMilliseconds]

Arguments

ParameterDescription
lMilliseconds Optional. A long integer value.
The time, in milliseconds, after which UFT One continues to the next step if the specified value is not achieved. If no value is specified, UFT One uses the time set in the Object Synchronization Timeout option in the Run pane of the Test Settings dialog box.
Default value = 0

Return Type

None

Example

Back to top

 

Type Method

Description

Types the specified string at the current location of the cursor.

Syntax

object.Type wsTypeSeq

Arguments

ParameterDescription
wsTypeSeq Required. A String value.
The text string and/or constants representing non-alphanumeric keys. The following constants are available:

 

Constant
Action
micCtrlDwn
Presses the Ctrl key.
micCtrlUp
Releases the Ctrl key.
micLCtrlDwn
Presses the left Ctrl key.
micLCtrlUp
Releases the left Ctrl key.
micRCtrlDwn
Presses the right Ctrl key.
micRCtrlUp
Releases the right Ctrl key.
micAltDwn
Presses the Alt key.
micAltUp
Releases the Alt key.
micLAltDwn
Presses the left Alt key.
micLAltUp
Releases the left Alt key.
micRAltDwn
Presses the right Alt key.
micRAltUp
Releases the right Alt key.
micShiftDwn
Presses the Shift key.
micShiftUp
Releases the Shift key.
micLShiftDwn
Presses the left Shift key.
micLShiftUp
Releases the left Shift key.
micRShiftDwn
Presses the right Shift key.
micRShiftUp
Releases the right Shift key.
micIns
Presses the Insert key.
micDel
Presses the Delete key.
micHome
Presses the Home key.
micEnd
Presses the End key.
micPgUp
Presses the Page Up key.
micPgDwn
Presses the Page Down key.
micUp
Presses the Up arrow key.
micDwn
Presses the Down arrow key.
micLeft
Presses the Left arrow key.
micRight
Presses the Right arrow key.
micEsc
Presses the Esc key.
micBack
Presses the Backspace key.
micReturn
Presses the Return key.
micTab
Presses the Tab key.
micBreak
Presses the Break key.
micPause
Presses the Pause key.
micPrintScr
Presses the Print Screen key.

micWinLogoDwn
Presses the Windows Logo key.
micWinLogoUp
Releases the Windows Logo key.
micLWinLogoDwn
Presses the left Windows Logo key.
micLWinLogoUp
Releases the left Windows Logo key.
micRWinLogoDwn
Presses the right Windows Logo key.
micRWinLogoUp
Releases the right Windows Logo key.
micAppKey
Presses the Application key.
micF1
Presses the F1 key.
micF2
Presses the F2 key.
micF3
Presses the F3 key.
micF4
Presses the F4 key.
micF5
Presses the F5 key.
micF6
Presses the F6 key.
micF7
Presses the F7 key.
micF8
Presses the F8 key.
micF9
Presses the F9 key.
micF10
Presses the F10 key.
micF11
Presses the F11 key.
micF12
Presses the F12 key.
micNumLockOn
Turns on the Num Lock.
micCapsLockOn
Turns on the Caps Lock.
micScrollOn
Turns on the Scroll Lock.
micNumLockOff
Turns off the Num Lock.
micCapsLockOff
Turns off the Caps Lock.
micScrollOff
Turns off the Scroll Lock.

 

Return Type

None

IMPORTANT

Tip: If you want to type the string into a specific location on the emulator screen, use the TeTextScreen.ClickPosition statement to move the cursor to the correct field before using the Type method. For more information, see ClickPosition.

Example

Back to top

 

WaitString Method

Description

Waits for a specified string to appear on the emulator screen before continuing the run session.

Syntax

object.WaitString (Text, [TopRow], [LeftCol], [BottomRow], [RightCol], [Milliseconds], [RegExp])

Arguments

ParameterDescription
Text Required. A String value.
The text string that must appear on the screen. If the value of the RegExp argument is True, UFT One recognizes the string as a regular expression.
TopRow Optional. A long integer value.
The top coordinate of the rectangle. The first row in the screen is 1.
Default = 1

Default value = 0
LeftCol Optional. A long integer value.
The left coordinate of the rectangle. The first column in the screen is 1.
Default = 1

Default value = 0
BottomRow Optional. A long integer value.
The bottom coordinate of the rectangle.
Default = last row number

Default value = 0
RightCol Optional. A long integer value.
The right coordinate of the rectangle.
Default = last column number

Default value = 0
Milliseconds Optional. A long integer value.

The time, in milliseconds, after which UFT One continues to the next step if the specified value is not achieved.

For tests, if no value is specified, UFT One uses the time set in the Object Synchronization Timeout option in the Run pane of the Test Settings dialog box.

For components, if no value is specified, UFT One uses the default Object Synchronization Timeout setting.


Default value = 0
RegExp Optional. A long integer value.
If True, UFT One recognizes the Text argument as a regular expression. If False, UFT One recognizes this argument as text. For more information about regular expressions, refer to the UFT One User Guide.
Default = False

Default value = 0

Return Type

A Boolean value.

IMPORTANT

You can optionally define a specified rectangle where the string should appear on the screen. The string can be a constant string or a regular expression.

Example

Back to top

 

ColumnCount Property

Description

Returns the total number of columns in the emulator screen.

Syntax

object.ColumnCount

Value Type

A long integer value.

Property type

Read-only property

Example

Back to top

 

RowCount Property

Description

Returns the total number of rows (lines) on the emulator screen.

Syntax

object.RowCount

Value Type

A long integer value.

Property type

Read-only property

Example

Back to top

See also: