TeField Object
Description
A terminal emulator field that fully supports HLLAPI.
IMPORTANT
The TeField object includes both unprotected fields, which can receive input, and protected fields, which contain fixed text.
Operations
The sections below list the built-in methods and properties that you can use as operations for the TeField object.
Note: You can also view a list and descriptions of the TeField 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
CaptureBitmap | Saves a screen capture of the object as a .png or .bmp image using the specified file name. |
Check | Checks whether the actual value of an item matches the expected value. |
CheckProperty | Checks whether the actual value of the specified object property matches the specified expected value within the specified timeout. |
ChildObjects | Returns the collection of child objects contained within the object. |
GetAllROProperties | Returns the collection of properties and current values from the object in the application. |
GetROProperty | Returns the current value of the description property from the object in the application. |
GetTOProperties | Returns the collection of properties and values used to identify the object. |
GetTOProperty | Returns the value of the specified description property from the test object description. |
Highlight | Highlights the object in the application. |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs OpenText Functional Testing to re-identify the object in the application the next time a step refers to this object. |
Set | Inserts text into an unprotected field. |
SetCursorPos | Places the cursor in the specified position within the field. |
SetSecure | Inserts text into a hidden (invisible) field. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
ToString | Returns a string that represents the test object. |
WaitProperty | Waits until the specified object property achieves the specified value or exceeds the specified timeout before continuing to the next step. |
Properties
BackgroundColor | Returns the background color of the field. |
Color | Returns the color of the text in the field. |
Exist | Checks whether the object currently exists in the open application. |
Text | Returns the contents of a field. |
Set Method
Description
Inserts text into an unprotected field.
Syntax
object.Set Text, [PositionInField]
Arguments
Parameter | Description |
---|---|
Text |
Required. A String value. The text to be inserted in the field. |
PositionInField |
Optional. A long integer value. The offset of the insertion position from the first character in the field (in characters). If no offset is specified, the default is 0. Default value = 0 |
Return Type
None
IMPORTANT
The Set method can be used for any unprotected field. However, when recording, the Set method is used for unprotected visible fields, and the SetSecure method is used for hidden fields. For more information, see SetSecure.
Example
'The following example uses the Set method to insert "GUEST" into the '"User" field. TeWindow("TeWindow").TEScreen("Flights LOGON").TEField("User").Set "GUEST"
SetCursorPos Method
Description
Places the cursor in the specified position within the field.
Syntax
object.SetCursorPos [PositionInField]
Arguments
Parameter | Description |
---|---|
PositionInField |
Optional. A long integer value. The offset of the insertion position from the first character in the field (in characters). If no offset is specified, the default is 0. Default value = 0 |
Return Type
None
Example
'The following example uses the SetCursorPos method to place the cursor in 'the fourth character position in the "User" field. TeWindow("TeWindow").TEScreen("Flights LOGON").TEField("User").SetCursorPos 4
SetSecure Method
Description
Inserts text into a hidden (invisible) field.
Syntax
object.SetSecure CodedString
Arguments
Parameter | Description |
---|---|
CodedString |
Required. A String value. OpenText Functional Testing decodes and inserts the coded string into the field. |
Return Type
None
IMPORTANT
A hidden field is typically used for a password. The SetSecure method is recorded when a password or other secure text is entered. The text is encrypted while recording, and decrypted during the test run.
The Set method can be used instead of the SetSecure method for any unprotected or hidden field. However, when recording, the Set method is used for unprotected fields and the SetSecure method for hidden fields. For more information, see Set.
To find the encoded value to use as the argument for the this method, do one of the following:
Use the Password Encoder utility (available from the Windows Start menu).
- Parameterize the argument using a Data Table parameter and use the Data Table encryption option (right-click each unencrypted value in the password column and choose Data > Encrypt).
For more information, refer to the OpenText Functional Testing User Guide.
While the SetSecure method enables you to hide passwords on the screen during a run session, it is not intended to be a secure way to protect password information.
Example
'The following example uses the SetSecure method to decode the '"3c0baa1e13d4f6fe76bfda" string and insert it into the Password field. TeWindow("TeWindow").TEScreen("Flights LOGON").TEField("Password").SetSecure "3c0baa1e13d4f6fe76bfda"
BackgroundColor Property
Description
Returns the background color of the field.
Syntax
object.BackgroundColor
Value Type
A String containing a Hexadecimal color code.
Property type
Read-only property
Example
'The following example uses the BackgroundColor property to retrieve the background color of the '"User" field. BgdColor = TeWindow("TeWindow").TEScreen("Flights LOGON").TEField("User").BackgroundColor MsgBox "The background color is " & BgdColor
Color Property
Description
Returns the color of the text in the field.
Syntax
object.Color
Value Type
A String containing a Hexadecimal color code.
Property type
Read-only property
Example
'The following example uses the Color property to retrieve the text color from the '"User" field. Color = TeWindow("TeWindow").TEScreen("Flights LOGON").TEField("User").Color MsgBox "The color is " & Color
Text Property
Description
Returns the contents of a field.
Syntax
object.Text
Value Type
A String value.
Property type
Read-only property
Example
'The following example uses the Text property to retrieve text from the "User" field. UserName = TeWindow("TeWindow").TEScreen("Flights LOGON").TEField("User").Text MsgBox "Hello " & UserName
See also: