These examples show how to run the rulesets using Selenium Webdriver.
We assume the following are installed:
To check if ChromeDriver and Python 2.7.16 have already been installed, type the appropriate commands to print the version.
$ chromedriver --version
ChromeDriver 2.40.565498 (ea082db3280dd6843ebfb08a625e3eb905c4f5ab)
$ python --version
Python 2.7.16
$ pip --version
pip 18.1 from c:\python27\lib\site-packages\pip (python 2.7)Note: Python 2.7 is required but other than that, versions may vary.
If the prerequisite has not been installed, first use the information below to install, then run the appropriate commands to print the version (ie verify the installation by running the commands above).
Selenium is a tool that automates browsers and ChromeDriver is the Chrome implementation of WebDriver, which is an open source tool for automated testing of webapps across many browsers.
See Chrome Driver Help for more information about installation.
Python is an interpreted high-level programming language. Its built in data structures and dynamic typing make it attractive for rapid development and scripting. Visit the Python 2.7.16 Release for various installers.
Note: Windows users are recommended to use the Git Bash console to run Node.js. An Installer may be found on the Git Downloads.
Note: Windows users may need to add the location of Python (ie C:\Python27) to the Path environment variable.
pip is the package installer for Python. pip comes preinstalled for Python versions above Python 2.7.9. If you need to install pip manually, you may visit the pip installation page.
Note: Windows users may need to add the location of pip (ie C:\Python27\Scripts) to the Path environment variable.
Run the following commands:
git clone https://github.com/eBay/accessibility-ruleset-runner/
cd accessibility-ruleset-runner/examples/pythonNote: If you are working from a forked repository, you might use slightly different commands than those given above. Also, if you have already downloaded the code, you can skip step.
To install the selenium dependency, run the following command from the examples/python directory:
pip install seleniumTo verify selenium (ie version 3.141.0) and urllib3 (ie version 1.25.3) were installed successfully, run the following command from the examples/python directory:
pip freezeTo run the Custom Ruleset, run the following command from the examples/python directory:
python custom.ruleset.runner.pyThe output should match the Custom Ruleset Runner Output.
To run the aXe Ruleset, run the following command from the examples/python directory:
python aXe.ruleset.runner.pyThe output should match the aXe Ruleset Runner Output.
The examples are setup to be run without any configuration necessary. However, users can test a different url by modifying the following line:
driver.get("https://www.ebay.com")In addition, sometimes users need to sign in, load urls, click buttons, etc before testing a view. Consider making the appopriate modifications necessary for your use case.