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. 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 ~. 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 symbols: [ENTER], [TAB], [BACKSPACE], [DELETE], [ARROWUP], [ARROWDOWN], [ARROWLEFT], [ARROWRIGHT]. You can type these into the edit form, or 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 mabl Trainer. In this case, you can use a CSS or XPath query to select an element and send a keypress directly to it.

  1. Click the "Add step" plus sign button in the bottom menu of the Trainer.
  2. Select the "Find elements" step.
  3. Set the Action to "Send keypress. The query shown below will find the First Element matching the div query in the page and perform the selected action there.
548548
  1. Click OK. The Trainer window will show a configuration menu for the keypress action.
  2. Check any number modifier keys to be active during the keypress, as well as the main key to press, including special characters: [ENTER], [TAB], [BACKSPACE], [DELETE], [ARROWUP], [ARROWDOWN], [ARROWLEFT], [ARROWRIGHT]. For a "space" keypress, enter [ ] (one space between square brackets).
550550

📘

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

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.