How to use keystrokes as workarounds


When automating a browser, you may need to use workarounds for issues like being unable to select an element. One category of these workarounds includes keyboard shortcuts or hotkeys. These provide alternative methods for actions typically performed with a mouse, such as cutting, copying, and pasting, commonly executed via keyboard.

To utilize the power of keyboard shortcuts, you can use the "Press key(s)" step to record and reuse combinations of hotkeys.

adding a Press key(s) step in axiom.ai builder

How to record keyboard shortcuts with the keypress step

In the axiom.ai builder, open your automation and navigate to the point where you wish to add a new step. Then, open the step finder, search for, and add the "Press key(s)" step. Inside the step, Click record, then press the keys you want the bot to press. You can record a sequence of keys. The bot will enter these one by one, except for Ctrl, Alt, or Shift, which will be held down until the end of the sequence.

recording key presses in axiom.ai's builder

Examples of keyboard workarounds

Keyboard shortcut / hotkeyExamples
Up/down arrowsScroll a page or a box with scrollbars
Left/right arrowsMove the cursor left or right in an input field
TabTab to move cursor on the page
TabTab between fields in a form
TabIn pop up windows tab to select elements
ReturnSubmit message in a chat interface
ReturnPress a button
CV+PCopy and paste just like a human
DeleteDelete values in a text field

Ensuring the cursor is correctly placed

Sometimes, you must position the mouse cursor so the shortcut works effectively. For instance, to scroll within a box with up/down arrows, you would use a "Click element" step to activate it. Similarly, for an input field, you must ensure the cursor is inside the field by using a "Click element" step.

Wrapping up

Recording keyboard shortcuts is a valuable workaround in browser automation, helping bypass issues. Correct cursor placement is crucial to ensure correct execution of the recorded shortcuts.