Recording keypresses

There are two ways to record keypress steps in the mabl trainer. Once created, keypress steps are fully editable by clicking the pencil icon on the recorded step.

Method 1. Simply type in your app while recording is live

In recording mode, mabl will record any keys or shortcuts you press while interacting with the application under test. Your steps will automatically be added at the trainer's step cursor with the syntax of Send "sample" keypresses to...

Mabl can record most single keypresses, including letters, numbers, and many special characters such as !, ?, /, #, ~, and more. Mabl can also record keypress combinations such as Ctrl+L, or Alt+Shift+T

For clarity, the following special characters are spelled out instead of using the character simbols: [ENTER], [TAB], [BACKSPACE], [DELETE], [ARROWUP], [ARROWDOWN], [ARROWLEFT], [ARROWRIGHT]. You can type these into the edit form, or simply hit the key as you would any other.


Collapsing keypress steps

Keypresses that do not use modifier keys will be collapsed into a single step. This saves execution time and preserves readability in the trainer.

Method 2. Send a keypress using a custom find step
This is a good option if the target element is difficult to focus, or if the app under test has key handlers that prevent the key events from reaching the trainer. In this case, you can use a css or xpath query to select an element and send a keypress directly to it.

Clicking the magnifying glass in the trainer's lower toolbar will open the custom find form:

Send keypress is one of several actions available in the dropdown menu. The query shown above will find the First Element matching the div query in the page and perform the selected action there. Next, you will be taken to this form after clicking OK:

Here, you can check any number modifier keys to be active during the keypress, as well as the main key to press. You can also use the special characters mentioned above such as [TAB].


Operating System Differences

Many mabl users run tests on Internet Explorer on Windows, or Safari on MacOS. Chrome and Firefox tests are run on Linux.

Different operating systems may have different shortcuts to accomplish the same function. (e.g. Ctrl+a to "select all" works on Windows and Linux, but MacOS uses Cmd+A for the same function).

The edit form for keypress steps allows users to choose a separate set of keys to press depending on the operating system. If an override for MacOS is present, it will be used during Safari executions. If none are present, the primary keypress at the top of the form will be used.



MacOS handles many global keyboard shortcuts at the system level. Unfortunately, this means we cannot trigger that functionality in the browser during mabl test runs. Examples include Cut, Copy, Paste, SelectAll, Undo, and Redo. We apologize for any inconvenience this causes.

Did this page help you?