SAPGuiTextArea Object
Description
A text area in an SAP GUI for Windows application.
Operations
The sections below list the built-in methods and properties that you can use as operations for the SAPGuiTextArea object.
Note: You can also view a list and descriptions of the SAPGuiTextArea 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. |
DoubleClick | Double-clicks inside a text area at the cursor position. |
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 | Sets the specified text in the text area. |
SetSelectionIndexes | Selects the specified section of text in the text area and positions the cursor. |
SetTOProperty | Sets the value of the specified description property in the test object description. |
SetUnprotectedTextPart | Sets the specified text in the predefined unprotected sections of the text area. |
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
Exist | Checks whether the object currently exists in the open application. |
Object | Accesses the native methods and properties of the object. |
DoubleClick Method
Description
Double-clicks inside a text area at the cursor position.
Syntax
object.DoubleClick
Return Type
None.
Example
'The following example uses the DoubleClick method to double-click the cursor inside a text area 'at the position (710,710). SAPGuiSession("Session").SAPGuiWindow("ABAP Editor:").SAPGuiTextArea("TextAreaControl").SetSelectionIndexes 710, 710 SAPGuiSession("Session").SAPGuiWindow("ABAP Editor:").SAPGuiTextArea("TextAreaControl").DoubleClick
Set Method
Description
Sets the specified text in the text area.
Syntax
object.Set (Text)
Arguments
Parameter | Description |
---|---|
Text |
Required. A String value. The text to set in the text area. |
Return Type
None.
Example
'The following example uses the Set method to type "This is a new material to purchase in the "TextAreaControl" 'text area." SAPGuiSession("Session").SAPGuiWindow("Create Purchase").SAPGuiButton("Expand").Click SAPGuiSession("Session").SAPGuiWindow("Create Purchase").SAPGuiTextArea("TextAreaControl").Set "This is a new material to purchase" + vbCr + "" SAPGuiSession("Session").SAPGuiWindow("Create Purchase").SAPGuiButton("Collapse").Click
SetSelectionIndexes Method
Description
Selects the specified section of text in the text area and positions the cursor.
Syntax
object.SetSelectionIndexes (Start, End)
Arguments
Parameter | Description |
---|---|
Start |
Required. A long integer value. The position of the first character of the text to be selected (highlighted) in the text area. Character position numbering starts from zero. |
End |
Required. A long integer value. The position of the character that ends the selection in the text area (this character is not highlighted). The cursor is set to this position. If Start = End, no text is highlighted and the cursor is set to this character position. |
Return Type
None.
IMPORTANT
The text is selected from the specified start character and up to, but not including, the end character.
Example
'The following example uses the SetSelectionIndexes method to highlight the three letters ELL (positions 1, 2 and 3) 'in the string HELLO and position the cursor on the character at position 4 (The letter "O"), which is not highlighted. SAPGuiSession("Session").SAPGuiWindow("EnjoySAP Demo").SAPGuiTextArea("TextAreaControl").Set "" + vbCr + "HELLO" + vbCr + "" SAPGuiSession("Session").SAPGuiWindow("EnjoySAP Demo").SAPGuiTextArea("TextAreaControl").SetSelectionIndexes 1, 4
'The following example uses the SetSelectionIndexes method to position the cursor immediately after the string 'HELLO in the text area (on character 5). SAPGuiSession("Session").SAPGuiWindow("EnjoySAP Demo").SAPGuiTextArea("TextAreaControl").Set "" + vbCr + "HELLO" + vbCr + "" SAPGuiSession("Session").SAPGuiWindow("EnjoySAP Demo").SAPGuiTextArea("TextAreaControl").SetSelectionIndexes 5, 5
SetUnprotectedTextPart Method
Description
Sets the specified text in the predefined unprotected sections of the text area.
Syntax
object.SetUnprotectedTextPart (Part, Text)
Arguments
Parameter | Description |
---|---|
Part |
Required. A long integer value. The number of the unprotected section in which the text is set. Unprotected sections of the text area are numbered from top to bottom, starting from 1. |
Text |
Required. A String value. The text to set in the specified unprotected part of the text area. |
Return Type
None.
Example
'The following example uses the SetUnprotectedTextPart method to type the text Purchase Order, Order Number 5678 'and Authorized in the unprotected sections of the "TextAreaControl" text area. The three text strings are entered 'into sections 1, 2, and 3 respectively, starting from the top of the text area: SAPGuiSession("Session").SAPGuiWindow("Company IDES").SAPGuiTextArea("TextAreaControl").SetUnprotectedTextPart 1, "Purchase Order" + vbCr + "" SAPGuiSession("Session").SAPGuiWindow("Company IDES").SAPGuiTextArea("TextAreaControl").SetUnprotectedTextPart 2, "Order Number 5678" + vbCr + "" SAPGuiSession("Session").SAPGuiWindow("Company IDES").SAPGuiTextArea("TextAreaControl").SetUnprotectedTextPart 3, "Authorized" + vbCr + ""
See also: