Version v4.25.0 of Selenium added some support for WebDriver BiDi (https://w3c.github.io/webdriver-bidi/) this should make it possible to execute javascript asyncronously. I think it'd be good to add extensions for the BrowsingContext to run axe against the page if possible.
BiDi information:
WebDriverOptions (ex: ChromeOptions) need to have UseWebSocketUrl enabled in order to use BiDi
to get a bidi driver use AsBiDiContextAsync on a WebDriver object.
Here is an example of some code using BiDi to get the title of the page asyncronously:
using OpenQA.Selenium.BiDi;
using OpenQA.Selenium.BiDi.Modules.BrowsingContext;
namespace BidiExample;
public class BidiTest
{
public async Task MyMethod()
{
var options = new ChromeOptions
{
UseWebSocketUrl = true
};
var driver = new ChromeDriver(options);
var biDiContext = await driver.AsBiDiContextAsync();
var title = await biDiContext.GetPageTitleAsync();
Assert.NotNull(title);
}
// Here is some example code on how to execute a script and return the value using the BrowsingContext from BiDi:
public static async Task<string> GetPageTitleAsync(this BrowsingContext bidiContext)
{
return (await bidiContext.Script.EvaluateAsync<StringRemoteValue>("document.title", true)).Value;
}
}
Which package is this feature for?
Feature description
Version v4.25.0 of Selenium added some support for WebDriver BiDi (https://w3c.github.io/webdriver-bidi/) this should make it possible to execute javascript asyncronously. I think it'd be good to add extensions for the BrowsingContext to run axe against the page if possible.
BiDi information:
Here is an example of some code using BiDi to get the title of the page asyncronously: