There are several different methods for typing text on systems under test (SUTs). You can type directly into the SUT in Live Mode, automate keystrokes using the
TypeText command in your script, and even encode text like passwords using the
Typing in Live Mode
When you are controlling the SUT through Eggplant Functional, most of your keystrokes are automatically sent to the SUT. However, there are a few keystrokes and key combinations that are intercepted by the Eggplant Functional computer before they can be sent to the SUT. (For example, on Mac OS X, Command-Tab changes focus to the next application.)
To send one of these keyboard shortcuts to the SUT, choose the shortcut in the Control menu.
Automating Keystrokes Using the TypeText Command
You can automate keystrokes on the SUT by using the
TypeText command in your script.
TypeText takes any number of the following parameters, separated by commas:
- String: Text in quotation marks, typed literally.
- TypeText Keyword: The name of a non-character key (such as Escape), or key that cannot be identified by a character alone, such as keypad numbers. See the TypeText Keywords for a list of all
Examples: The TypeText Command
TypeText "Sarah Smith"// Types Sarah Smith on the SUT.
TypeText "Sarah",space,"Smith" // Types Sarah Smith on the SUT.
TypeText ControlKey, AltKey, DeleteKey // Holds down Control and Alt, and presses Delete. (Control and Alt are released at the end of the command.)
TypeText ShiftKey,"Sarah ", "Smith" // Holds the shift key and types SARAH SMITH. (Shift is released at the end of the command.)
Recording TypeText statements
In the Viewer window, you can create
TypeText statements by recording your keystrokes. To start a
TypeText command in Capture mode, press the space bar or type any characters. The TypeText panel opens. In Live mode or Capture mode, you can also click the TypeText button in the Viewer Window toolbar.
TypeText panel is open, your keystrokes are inserted into the text field. Non-character keys and quotation marks are inserted as
TypeText keywords; character keys are inserted as literal text. As you are typing, you can select and edit the text in the text field.
Recording intercepted keystrokes
When you are using the
TypeText panel, some key commands cannot be typed directly because they are intercepted by the computer. For example, the Return key acts as an OK button. To insert one of these key commands into your
TypeText statement, choose the command from the Enter Keystroke pop-up menu.
The TypeEncodedText Command
If you need to use a password or other sensitive information in your script and do not want to pass it as plain text, you can use the
TypeEncodedText command. It works along with the
EncodeText to encode plain text, such as a password. The
DecodeText function returns the encoded text to plain text. The
TypeEncodedText command decodes the text and sends keystrokes to the SUT like a standard
TypeText command. With
TypeEncodedText, the text is not logged or otherwise recorded by Eggplant Functional.
You can use the Insert drop-down list in the Suite window to add the
TypeEncodedText command to your script. Select Insert > TypeEncodedText to open the Encoded Text dialog box, then enter the text you want to encode in the Un-encoded field and the optional key in the Key field. Click Save to insert the command and the encoded string into your script.
Enter text that you wish to encode in the Insert Encoded Text dialog box
For more information about these commands and functions, see Text Encryption.