Visitar URL original
axe-devtools-html-api-examples/Python/python_selenium at main · dequelabs/axe-devtools-html-api-examples · GitHub
Skip to content

Latest commit

 

History

History

python_selenium

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

README.md

logo

axe DevTools Python API Example

Using axe DevTools Python, you can integrate axe DevTools into your existing testing environment. This example project demonstrates how axe DevTools Python is used to detect accessibility issues and generates reports in CSV, HTML, JSON, and XML formats.

Prerequisites

Python 3 (does not support Python 2) along with the virtual environment (venv or pyenv).

Clone Project

Follow these steps to clone and navigate to the directory:

  1. Clone this repo from GitHub.
  2. Open the project in your favourite python IDE.
  3. Navigate from the root of the repo to this example with the following command:
cd Python/python_selenium

Binary Reporter

Download the respective Binary reporter for your operating system and place it in the resources directory.

Install Dependencies

Install the dependencies including axe DevTools API and DevTools Selenium for the project.

NOTE: You need a valid license to use our APIs. For more information, see Install from Deque’s Agora page. After configuring the access to Deque's private registry, you can install the dependencies for this project.

The following command installs all the required dependencies to run this example project.

pip install -r requirements.txt

Run Tests

The tests directory contains the example test file test_example.py that analyzes the page https://broken-workshop.dequelabs.com/ for accessibility issues.

Navigate to the tests directory with the following command:

cd tests

The following command runs the test file in the tests directory.

python -m test_example

Test Results

The tests generate results in the a11y-results directory if you have installed the Binary reporter. Otherwise, they generate only JSON results.

The executive-report.html file is an executive summary report aggregating results from all scans into one page.

Every time you run python -m test_example, it replaces all previously saved results with the latest results in the a11y-results directory, so if you want to retain previous test results, you should rename or save them in a different directory.

If you want to modify this project and publish your results in a folder other than ./ally-results, you should update the output directory in the test_example.py file.

Additional Information