Usage with Selenium
Selenium WebDriver is the long-standing standard for driving real browsers from any language — the most established cross-browser automation tool, commonly used for end-to-end testing. surea11y integrates through the @surea11y/selenium binding.
$ npm install @surea11y/selenium selenium-webdriver
selenium-webdriver bundles Selenium Manager, which auto-downloads and manages the matching chromedriver the first time you build a driver — no separate Selenium server, no manual driver install (Chrome itself must already be on the machine).
const { Builder, Browser } = require('selenium-webdriver');const chrome = require('selenium-webdriver/chrome');const { A11yCoreBuilder } = require('@surea11y/selenium');const options = new chrome.Options().addArguments('--headless=new');const driver = await new Builder().forBrowser(Browser.CHROME).setChromeOptions(options).build();await driver.get('https://example.com/');const results = await new A11yCoreBuilder({ driver }).include('#main') // optional -- call multiple times for multi-region scans.exclude('.cookie-banner') // optional.withTags(['wcag2a', 'wcag2aa']).disableRules(['meta-refresh-no-exceptions']).analyze();console.log(results.checksResults.filter(r => r.outcome === 'fail'));await driver.quit();
The builder takes { driver } (a Selenium WebDriver), where Puppeteer/Playwright take { page } — that's the one construction difference. Everything downstream is identical.
Also see a runnable example in the package's own repo.
Next: choose which rules run, integrate the scan into CI, and review the full result schema.