Sample code
import pytest
from selenium import webdriver
from axe_selenium_python import Axe
driver = webdriver.Chrome()
driver.get("http://www.google.com")
axe = Axe(driver)
# Inject axe-core javascript into page.
axe.inject()
# Run axe accessibility checks.
results = axe.execute()
# Write results to file
axe.write_results('a11y.json', results)
driver.close()
# Assert no violations are found
assert len(results["violations"]) == 0, axe.report(results["violations"])
This outputs results as {}
But if i axe.run() in the console i get this output:
