Axe DevTools C# Overview
Overview of Axe DevTools for Web for C#, including prerequisites and known limitations
Axe DevTools C# includes:
- axe-core version 4
- Microsoft Visual Studio 2019 IDE support
- Microsoft .NET Core 2.2.0 CLI support
Scans run against WCAG 2.1 Level AA by default, with best-practice and experimental rules turned off. See Customizing Rules to change the ruleset or enable best practices.
Prerequisites
Axe DevTools requires a Selenium WebDriver binding for a browser of your choice. To use Axe DevTools, you must first install and configure Selenium WebDriver.
Assumptions and Known Limitations
-
Using this integration assumes:
- You have set the desired state of page prior to running the tests.
- You have not modified the Selenium object other than to run axe and apply your configuration.
- You close the tested web page upon test completion.
-
Best practice: Do not run additional tests without refreshing the page. Changing the state of a web page during a Selenium test run and running the tests without restoring the original expected page state will cause unpredictable testing results. Axe DevTools C# may inject content into a web page during testing. Attempts to run Axe DevTools repeatedly on a page that was previously tested will cause unpredictable testing results.
Custom Elements and ElementInternals
Starting in Axe DevTools C# 4.13.0, scans read the ARIA semantics that web components declare in JavaScript through ElementInternals, rather than only the role and aria-* attributes present in the markup. No configuration is required. Semantics in the DOM still take precedence: an explicit role or aria-* attribute on the element overrides the value from ElementInternals.
Your components must publish their internals for any of this to take effect, and a component that stores them in a private class field cannot be read. See Testing Custom Elements That Use ElementInternals.
