Skip to content

Getting empty results even though there are violations on the page #118

@sshaar08

Description

@sshaar08

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:

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions