Skip to Content
E2E test frameworksSelenium C#Getting started

Intro

The UserWay.WebAccessibility.Selenium is a .NET library designed to help you perform accessibility testing on your web pages. Using this tool you can easily run static analysis on a webpage and get a detailed report of accessibility violations based on WCAG guidelines and ACT rules. The library extends Selenium testing framework, making it easy to integrate with your existing testing workflow by using a few lines of code.

// xUnit example test public class MyE2ETest { [Fact] void BasicExampleTest() { var driver = new ChromeDriver(); driver.Url = "https://my.site.com"; var analysisConfig = new AnalysisConfigBuilder().Build(); var auditConfig = new AuditConfigBuilder() .Driver(driver) .AnalysisConfiguration(analysisConfig) .Build(); var statistics = AccessibilityAuditor.UserWayAnalysis(auditConfig); Assert.InRange(statistics.IssuesFound, 100, 200); } }

Prerequisites

Selenium WebDriver 4.0.0 or higher

Distribution

UserWay.WebAccessibility.Selenium plugin for C# .NET is distributed via NuGet package manager

Installation

Add dependency in your project:

dotnet add package Userway.WebAccessibility.Selenium —version $SELECTED_VERSION

Now you can use static method AccessibilityAuditor#userwayAnalysis(AuditConfig) in your Selenium tests.

Last updated on