Typing on the SUT
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 TypeEncodedText
command.
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
TypeText
keywords.
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.
When the 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.