Safari has an option that lets you use the Tab key to highlight items on a web page:
This article covers how to use a pre-run executable to configure this option in Safari so you can use the Tab key in this way in your tests.
The Script
If using Mac OS 10.14 and below, save this script as a .sh
file, and either upload it to Sauce Storage, or to a local publicly accessible over the internet, such as a GitHub Gist.
#!/bin/bash
|
For Mac OS 10.15 and above, use below:
#!/bin/bash
|
Setting the prerun
Capability
You will need to specify the location of your script within the prerun capability of your tests as described in the Test Configuration Options topic. This Python example refers to a Sauce Storage location:
desired_capabilities['prerun'] = {
'executable':'sauce-storage:safaritabkey.sh',
'background': 'false'
}