Skip to main content

Python library to integrate axe and selenium for web accessibility testing.

Project description

axe-selenium-python integrates aXe and selenium to enable automated web accessibility testing.

License PyPI wheel Travis Issues


You will need the following prerequisites in order to use axe-selenium-python:

  • Python 2.7 or 3.6
  • pytest-selenium >= 3.0.0


To install axe-selenium-python:

$ pip install axe-selenium-python

To install pytest-axe:

$ pip install pytest-axe


To run tests using pytest-selenium (a dependency of axe-selenium-python), tests must be marked with the non-destructive pytest decorator:

def test_my_test_function():
  assert true

Test suites using axe-selenium-python must import pytest and the Axe class.

pytest-selenium relies on the base_url fixture, which can be set in a configuration file, or as a command line argument.

Configuration File

 base_url =

Command Line Argument

$ pytest --base-url

Example Test Function

import pytest
from axe_selenium_python import Axe
import pytest_axe

def test_accessibility(self, axe):

  response = axe.execute()

  assert len(response['violations']) == 0,

Tests not using the axe pytest fixture must use the selenium pytest fixture:

import pytest
from axe_selenium_python import Axe

def test_accessibility(self, selenium):

  axe = Axe(selenium)
  response = axe.execute()

  assert len(response['violations']) == 0,


version 0.0.276

  • Added pytest-axe usage example to README

version 0.0.275

  • Added usage example to README

version 0.0.273

  • Added selenium instance as a class attribute
  • Changed file paths to OS independent structure
  • Fixed file read operations to use with keyword

version 0.0.21

  • Fixed include of aXe API file and references to it
  • Updated README

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
axe_selenium_python-0.0.287-py2.py3-none-any.whl (67.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3
axe-selenium-python-0.0.287.tar.gz (63.9 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page