Simulating keyboards and special keys actions on Web and native application windows
When you record a test, you can simulate keyboard or special keys actions on web and native application windows, or navigation dialog boxes on browsers on Windows operating system. To simulate these actions, you can add the navigation action PressKey or InputKeys to the test script. Starting from HCL OneTest™ UI V9.2.1.1 of the product, you must enter the values in the correct format.
Before you begin
- You must have created a Web UI test from a recording.
- The test script must be open in the test editor.
Restriction:
- PressKey and InputKey are not supported on Mac operating system.
- Only basic key combinations such as [CTRL]+[A], [CTRL]+[C], [CTRL]+[V] that are executed in browsers are supported.
- New key combinations are not displayed in test scripts recorded with versions earlier to V9.2.1.1. If you want to benefit from the new key combinations in existing test scripts, you must remove the existing test steps and add new steps.
- Double-byte characters are not supported.
- PressKey and InputKey and any other actions
that use Robot APIs are not supported in the following scenarios:
- Screen is locked
- Application being tested is minimized
- Remote desktop window is minimized
This restriction is applicable irrespective of whether you initiate the execution from the product, command-line interface, or any integrations that invoke the test.
Procedure
- In the test script, place the cursor where the step must be added, and click .
- In the Test Element Details section, select InputKeys or PressKey in the list of objects actions.
-
For InputKeys and PressKey navigation
actions, specify the string in the edit field that is automatically entered at the playback
time when the step is replayed. The PressKey navigation action is used
to simulate the TAB key or specific kind of keys. The list of supported
navigation key values and their formats are as follows:
Key value Key format Tab [TAB] Shift [SHIFT] Enter [ENTER] Esc [ESCAPE] PgUp [PAGEUP] PgDn [PAGEDOWN] Home [Home] End [End] Left arrow key [Left] Right arrow key [Right] Up arrow key [Up] Down arrow key [Down] F1 to F12 [F1] ….[F12] Ctrl [CTRL] Alt [ALT] Delete [DEL] "=" [=] "-" [-] "+" [+] For example, [CTRL]+[ALT]+[S], [CTRL]+[C], [CTRL]+[V]
-
Optional: Select Native System Input to simulate the input keys or
special key actions at the screen level on the active window. This option is used to handle
non-HTML windows such as file browse dialogs. To interact with file browse dialog boxes, you
should keep your machine unlocked and the browser dialog box is in the foreground.
Notes:
- This option is not available for AFT parallel executions where multiple browser instances are running.
- This option is not available on Mozilla Firebox browser navigation.
- Save and run the test.