Configuring axe DevTools for Web CLI
Information about command-line options for the CLI
Axe DevTools for Web CLI can be configured with command-line flags or from a selenium-config file.
CLI Flags
The following CLI flags are available both when testing a workflow spec, and when testing pages. They will persist between runs of the axe DevTools for Web CLI as they modify the configuration.
Command-line help is all available through the CLI itself by running the command axe --help
Browser Selection Flag
This flag selects which browser to run. The selenium webdriver binding for the browser is required.
axe <url-or-spec-file> --browser=chrome
Headless Browser Mode
This flag sets the browser to launch in headless mode, meaning the browser is not displayed to the screen.
axe <url-or-spec-file> --headless
Window Size Control
This flag allows specification of the window size in pixels by width & height. The flag also controls the virtual window size in headless mode.
axe <url-or-spec-file> --window-size=<600,800>
Accept Untrusted SSL Certificates
This flag allows accepting untrusted SSL certificates
axe <url-or-spec-file> --accept-untrusted
Select a Remote Server
This flag allows the usage of a remote server such as BrowserStack or Sauce Labs
axe <url-or-spec-file> --remote-server <server-url>
Configure Page Load Timeout
This flag allows configuration of the page load timeout attribute. Default is 60,000 ms.
axe <url-or-spec-file> --page-timeout 60000
Configure Script Run Timeout
This flag allows the configuration of the max time allowed for a spec file to run. Default is 60,000 ms.
axe <url-or-spec-file> --script-timeout 60000
Configure Post Get pause
This flag allows the configuration of the period of time between getting a webpage and starting the scan. Default is 2000 ms.
axe <url-or-spec-file> --post-get-pause 2000
Configure Post Script Pause
This flag allows the configuration of the period of time between a scripting action and starting the scan. Default is 2000 ms.
axe <url-or-spec-file> --post-script-pause 2000
Configure Post Analyze Pause--post-analyze-pause [post-analyze-pause]
This flag allows the configuration of the period of time between starting a page analysis and moving on to the next action. Default is 2000 ms.
axe <url-or-spec-file> --post-analyze-pause 2000
--enable-tracking <state>
Enable data to be sent to the metrics library
--set-distinct-id <distinct-id>
Change the value of the distinct id being stored/used
--set-tracking-url <url>
Change the url where the metrics data is being sent to
config-selenium
As an alternative to using the above configuration flags, you can set the defaults of axe DevTools CLI with axe config-selenium
. You will be asked a number of questions, the results of which will be saved in a preferences configuration file. Some attributes are selectable with the arrow keys, and others are manually entered.
$ axe config-selenium
? Choose browser for running automated tests: (Use arrow keys)
? Choose browser for running automated tests: chrome
? Enter a value for pageLoadTimeout: 60000
? Enter a value for setScriptTimeout: 60000
? Accept untrusted ssl certs: Yes
? Enter a value for postGetPause: 2000
? Enter a value for postScriptPause: 2000
? Enter a value for postAnalysisPause: 2000
? Launch browser in headless mode: No
Results saved to ~/.config/preferences/com.deque.axe.devtools.cli.pref