SAPGuiEdit Object
Description
An edit box 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 SAPGuiEdit object.
Note: You can also view a list and descriptions of the SAPGuiEdit 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. |
OpenPossibleEntries | Opens the list of possible entries for the edit box. |
Output | Retrieves the current value of an item and stores it in a specified location. |
RefreshObject | Instructs UFT One to re-identify the object in the application the next time a step refers to this object. |
Set | Sets the value of an edit box in an SAP GUI for Windows application. |
SetCaretPos | Sets the position of the cursor within the edit box. |
SetFocus | Sets the focus on an edit box object in an SAP GUI for Windows application. |
SetSecure | Sets the encrypted value of an edit 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
Exist | Checks whether the object currently exists in the open application. |
Object | Accesses the native methods and properties of the object. |
OpenPossibleEntries Method
Description
Opens the list of possible entries for the edit box.
Syntax
object.OpenPossibleEntries
Return Type
None.
IMPORTANT
This method is not recorded. To add this method to your test, use the Step Generator or enter it manually in the Keyword View or . For more information, see the UFT One User Guide. When recording, UFT One records the actual operation, which is F4.
Example
'The following example uses the OpenPossibleEntries method to open the "Possible Entries" list for the '"Order Number" edit box. SAPGuiSession("Session").SAPGuiWindow("Display Sales").SAPGuiEdit("Order Number").SetFocus SAPGuiSession("Session").SAPGuiWindow("Display Sales").SAPGuiEdit("Order Number").OpenPossibleEntries
Set Method
Description
Sets the value of an edit box in an SAP GUI for Windows application.
Syntax
object.Set (Text)
Arguments
Parameter | Description |
---|---|
Text |
Required. A String value. The text to be entered in the edit field. |
Return Type
None.
Example
'The following example uses the Set method to enter the value 5545 in the "Order" edit box and then uses the '"SendKey ENTER" statement to press the ENTER keyboard key. SAPGuiSession("Session").SAPGuiWindow("Change Sales").SAPGuiEdit("Order").Set "5545" SAPGuiSession("Session").SAPGuiWindow("Change Sales").SendKey ENTER
SetCaretPos Method
Description
Sets the position of the cursor within the edit box.
Syntax
object.SetCaretPos (Position)
Arguments
Parameter | Description |
---|---|
Position |
Required. A long integer value. The character position where you want to place the cursor. Values begin with 0. |
Return Type
None.
IMPORTANT
This method is not recorded, but may be useful for edit boxes that are divided into active sections.
Example
'The following example uses the SetCaretPos method to set the cursor to the position of the second character 'in the edit box and then uses the "SendKey F2" statement to press the F2 keyboard key. SAPGuiSession("Session").SAPGuiWindow("Display Purch.").SAPGuiEdit("MEREQ_TOPLINE-BANFN_").SetFocus SAPGuiSession("Session").SAPGuiWindow("Display Purch.").SAPGuiEdit("MEREQ_TOPLINE-BANFN_").SetCaretPos 2 SAPGuiSession("Session").SAPGuiWindow("Display Purch.").SendKey F2
SetFocus Method
Description
Sets the focus on an edit box object in an SAP GUI for Windows application.
Syntax
object.SetFocus
Return Type
None.
IMPORTANT
This method is recorded on the object that has the focus when information is sent to the SAP server during a recording session. This ensures that the focus is on the correct object during the test run.
Example
'The following example uses the SetFocus method to set the focus on the "MEREQ_TOPLINE-BANFN_" edit box before 'pressing the F2 key on the keyboard. SAPGuiSession("Session").SAPGuiWindow("Display Purch.").SAPGuiEdit("MEREQ_TOPLINE-BANFN_").SetFocus SAPGuiSession("Session").SAPGuiWindow("Display Purch.").SAPGuiEdit("MEREQ_TOPLINE-BANFN_").SetCaretPos 2 SAPGuiSession("Session").SAPGuiWindow("Display Purch.").SendKey F2
SetSecure Method
Description
Sets the encrypted value of an edit field.
Syntax
object.SetSecure (EncryptedText)
Arguments
Parameter | Description |
---|---|
EncryptedText |
Required. A String value. The encrypted text to be entered in the edit box. |
Return Type
None.
IMPORTANT
The SetSecure method is not recorded. If you record in a password or other encrypted edit field, the Set method is recorded (For example, SAPGuiEdit("Password").Set "********"). To ensure that the correct value of an encrypted field is entered, change the Set method to a SetSecure method.
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 UFT One User Guide.
While the SetSecure method enables you to hide passwords on the screen when running a test, it is not intended to be a secure way to protect password information.
Example
'The following example uses the SetSecure method to take an encrypted password value from the '"Password_EncryptedText" column of the global data sheet. SAPGuiSession("Session").SAPGuiWindow("SAP R/3").SAPGuiEdit("User").Set "muster" SAPGuiSession("Session").SAPGuiWindow("SAP R/3").SAPGuiEdit("Password").SetSecure DataTable("Password_EncryptedText", dtGlobalSheet) SAPGuiSession("Session").SAPGuiWindow("SAP R/3").SAPGuiEdit("Password").SetFocus SAPGuiSession("Session").SAPGuiWindow("SAP R/3").SendKey ENTER
See also: