Back to all posts
Automated Accessibility Audits with Rotating Proxies

Automated Accessibility Audits with Rotating Proxies

November 24, 2026

Why Accessibility Testing Needs Geo‑Distributed IPs

Accessibility rules can behave differently depending on the user's locale, language, and network conditions. A component that passes in the US might fail in Germany because of date formats, right‑to‑left text, or region‑specific ARIA expectations. Running audits from a single IP hides those variations.

Rotating proxies let you execute the same test suite from many exit IPs without managing a fleet of machines. Each request appears to originate from a different geographic location, so you can verify that your site meets WCAG criteria worldwide.

Setting Up a Rotating Proxy for Playwright

Playwright supports HTTP and SOCKS5 proxies out of the box. The example below shows how to point a browser context at a rotating proxy gateway.

Configuring the Proxy in Playwright

import os
from playwright.sync_api import sync_playwright

# Proxy credentials – replace with your own values
PROXY_URL = "http://USERNAME:PASSWORD@GATEWAY_HOST:HTTP_PORT"
# For SOCKS5 on Pro/Business plans use:
# PROXY_URL = "socks5://USERNAME:PASSWORD@GATEWAY_HOST:SOCKS5_PORT"

def new_context_with_proxy():
    with sync_playwright() as p:
        browser = p.chromium.launch(headless=True)
        context = browser.new_context(
            proxy={"server": PROXY_URL},
            locale="de-DE",          # example: force German locale
            timezone_id="Europe/Berlin",
        )
        return context, browser

The proxy dictionary accepts the same URL format used by curl and requests. When you need a different exit IP, you rotate the underlying proxy (see next section) and then create a fresh context.

Rotating the IP on Demand

On Pro and Business plans you can trigger an immediate IP change via the API. The call requires the session identifier that you received when the proxy was provisioned.

import requests

def rotate_proxy_ip(session_id: str, api_key: str) -> bool:
    url = f"https://backend-api.ro-proxy.com/api/session/{session_id}/rotate"
    headers = {"Authorization": f"Bearer {api_key}"}
    resp = requests.post(url, headers=headers, timeout=10)
    return resp.status_code == 200

Call rotate_proxy_ip whenever your script detects a block, a CAPTCHA, or after a fixed number of pages. The API enforces a minimum interval between rotations; respect that delay to avoid 429 responses.

Writing an Accessibility Audit Script

We'll use axe-core via the axe-playwright package. It injects the axe engine into the page and returns a structured list of violations.

Installing Dependencies

pip install playwright axe-playwright requests
playwright install chromium

Core Audit Function

from axe_playwright import Axe

def run_audit(page, url: str):
    page.goto(url, wait_until="networkidle")
    axe = Axe()
    axe.inject(page)
    results = axe.run(page)
    return results.violations

The function returns a list of violation objects containing id, impact, description, and the offending nodes.

Handling Proxy Rotation in the Script

Combine the pieces: create a context, run the audit, rotate the IP, repeat for the next target locale.

def audit_across_regions(urls_by_locale: dict, session_id: str, api_key: str):
    all_results = {}
    for locale, url in urls_by_locale.items():
        # Rotate before each locale to get a fresh exit IP
        if not rotate_proxy_ip(session_id, api_key):
            print("Rotation failed, continuing with current IP")
        
        context, browser = new_context_with_proxy()
        # Override locale/timezone per region
        context.set_extra_http_headers({"Accept-Language": locale})
        page = context.new_page()
        
        try:
            violations = run_audit(page, url)
            all_results[locale] = violations
            print(f"{locale}: {len(violations)} violations")
        finally:
            context.close()
            browser.close()
    return all_results

if __name__ == "__main__":
    # Example mapping – adapt to your site
    targets = {
        "en-US": "https://example.com/",
        "de-DE": "https://example.com/de/",
        "ja-JP": "https://example.com/jp/",
    }
    SESSION_ID = "SESSION_ID"          # provided by your proxy dashboard
    API_KEY = "API_KEY"                # your personal API key
    results = audit_across_regions(targets, SESSION_ID, API_KEY)
    # Persist or upload results for later analysis
    import json
    with open("accessibility_report.json", "w") as f:
        json.dump(results, f, indent=2)

The script rotates the proxy before each locale, ensuring the exit IP matches the target region. Adjust the targets dictionary to cover the markets you care about.

Integrating Into CI/CD

Running the audit on every pull request catches regressions early. Below is a minimal GitHub Actions workflow.

GitHub Actions Example

name: Accessibility Audit
on:
  pull_request:
    branches: [main]
jobs:
  audit:
    runs-on: ubuntu-latest
    env:
      SESSION_ID: ${{ secrets.ROPROXY_SESSION_ID }}
      API_KEY: ${{ secrets.ROPROXY_API_KEY }}
    steps:
      - uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: "3.11"
      - name: Install deps
        run: |
          pip install playwright axe-playwright requests
          playwright install --with-deps chromium
      - name: Run audit
        run: python audit_script.py
      - name: Upload report
        uses: actions/upload-artifact@v4
        with:
          name: accessibility-report
          path: accessibility_report.json

Store SESSION_ID and API_KEY as repository secrets. The workflow installs Playwright with system dependencies, executes the script, and publishes the JSON report as an artifact for review.

Interpreting Results Across Regions

  1. Group by rule ID – Identify violations that appear in every locale (global issues) versus those that surface only in specific regions (locale‑specific markup, date pickers, RTL layouts).
  2. Prioritize by impact – critical and serious violations should be fixed first, regardless of region.
  3. Correlate with IP reputation – If a region shows an unusually high number of incomplete results, the exit IP might be blocked or throttled. Rotate again or switch to a sticky session for that locale.
  4. Track trends – Store each run's report in a time‑series database (e.g., InfluxDB) and graph violation counts per locale over time.

Conclusion

By coupling rotating proxies with a headless browser and an automated accessibility engine, you gain confidence that your site meets WCAG standards for every audience. The pattern—rotate, launch context, audit, repeat—scales to dozens of locales and fits neatly into any CI pipeline. When you configure the proxy in your code, use the gateway host, username, password, and HTTP (or SOCKS5) port provided by RoProxy. The same credentials power the on‑demand rotation API used in the examples above.