AxeWatcherDriverインターフェース

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard

WebDriverを拡張してSelenium Javaテストにアクセシビリティテスト機能を提供するインターフェース

Not for use with personal data

この AxeWatcherDriver インターフェースは、標準のSelenium WebDriver インターフェースを拡張して、アクセシビリティテスト機能へのアクセスを提供します。このインターフェースは、 AxeWatcher.wrapDriver() メソッドによって作成されるプロキシドライバーによって実装され、標準のWebDriver機能を維持しつつ、アクセシビリティテストのコントロールにアクセスできるようにします。

AxeWatcherDriver は、Seleniumテストの自動化とaxeアクセシビリティテスト機能の橋渡しとして機能し、 AxeWatcherController をいつどのように実行するかを制御することを可能にします。

インターフェース定義

がインターフェースであるため、コンストラクタはありません。その代わりに、WebDriverを AxeWatcherDriver メソッドでラップすることによって実装を取得します。 AxeWatcher.wrapDriver() メソッド。

public interface AxeWatcherDriver extends WebDriver {
    AxeWatcherController axeWatcher();
}

メソッド

axeWatcher()

アクセシビリティテスト操作を管理するコントローラーを返します。コントローラーは、自動分析の開始または停止、手動分析のトリガー、およびテスト結果のフラッシュを行うためのメソッドを提供します。

返却値:

  • AxeWatcherController - このドライバーに関連付けられたコントローラーインスタンス

例:

// First create and wrap a WebDriver
AxeWatcherOptions options = new AxeWatcherOptions().setApiKey("your-api-key").setProjectId("your-project-ID");
AxeWatcher watcher = new AxeWatcher(options);
ChromeOptions chromeOptions = watcher.configure(new ChromeOptions());
ChromeDriver chromeDriver = new ChromeDriver(chromeOptions);
WebDriver driver = watcher.wrapDriver(chromeDriver);

// Now access the controller through the AxeWatcherDriver interface
AxeWatcherController controller = ((AxeWatcherDriver) driver).axeWatcher();

// Use the controller to manage accessibility testing
controller.analyze();

関連項目