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.

.. image::
:alt: License
.. image::
:alt: PyPI
.. image::
:alt: wheel
.. image::
:alt: Travis
.. image::
:alt: 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
- `geckodriver <>`_ downloaded and `added to your PATH <>`_

- tox


To install axe-selenium-python:

.. code-block:: bash

$ pip install axe-selenium-python

To install pytest-axe:

.. code-block:: bash

$ pip install pytest-axe


.. code-block:: python

import pytest

def test_header_accessibility(selenium, base_url, axe):
violations ='header', None, 'critical')
assert len(violations) == 0,

The above example runs aXe against only the content within the *<header>* tag, and filters for violations labeled **critical**.

The method **** accepts three parameters: **context**, **options**, and

For more information on **context** and **options**, view the `aXe
documentation here <>`_.

The third parameter, **impact**, allows you to filter violations by their impact
level. The options are **critical**, **severe**, **moderate**, and **minor**, with the
default value set to **None**.

This will filter violations for the impact level specified, and **all violations with a higher impact level**.

To run the above test you will need to specify the browser instance to be invoked, and the **base_url**.

.. code-block:: bash

$ pytest --base-url --driver Firefox


- `Issue Tracker <>`_
- `Code <>`_
- `pytest-axe <>`_


version 0.0.3
- Added run method to Axe class to simplify the usage in existing test suites
- run method includes the ability to set what impact level to test for: 'minor', 'moderate', 'severe', 'critical'

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-1.0.0-py2.py3-none-any.whl (67.7 kB) Copy SHA256 hash SHA256 Wheel py2.py3
axe-selenium-python-1.0.0.tar.gz (64.3 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