The axe-core-selenium gem provides a chainable axe API for Selenium WebDriver and automatically injects into all frames.


  • In your Gemfile, add the axe-core-selenium gem.
source ""

gem 'axe-core-selenium'
  • Require axe-selenium and use the exported member AxeSelenium.
require 'axe-selenium'

# configure `AxeSelenium`

driver = AxeSelenium.configure(:firefox) do |c|
  # see below for a full list of configuration 
  c.jslib_path = "next-version/axe.js"

# use the driver configuration instance ''



The configure method takes 1 optional argument as a symbol and a configuration block object: configure(*arg, &block)

The optional argument is a browser name for selenium-webdriver. The valid browser names are:

  • :firefox (default)
  • :chrome
  • :safari

Note: Please ensure respective drivers (eg: geckodriver) are installed in your machine.

The block configuration object contains the below properties:

Property Type Description
jslib_path (Optional) String Path to a custom axe source
skip_iframes (Optional) Boolean Indicate if frames should be excluded from injecting with axe


Note: Refer to contributing guidelines for a full list of setup requirements.

Navigate to the directory of this gem - src/packages/axe-core-selenium

Install dependencies (declared in axe-core-selenium.gemspec):

bundle install

To run tests:

bundle exec rspec