Class WebDriverInjectorExtensions
- java.lang.Object
-
- com.deque.html.axecore.extensions.WebDriverInjectorExtensions
-
public final class WebDriverInjectorExtensions extends Object
Holds the Web driver injection extension methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ObjectexecuteAsyncScript(org.openqa.selenium.WebDriver webDriver, String command, Object... args)Execute an asynchronous JavaScript command.static ObjectexecuteScript(org.openqa.selenium.WebDriver webDriver, String command, Object... args)Execute an synchronous JavaScript command.static voidinject(org.openqa.selenium.WebDriver driver, IAxeScriptProvider scriptProvider, boolean disableIframeTesting)Injects Axe script into frames.static voidinject(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting)Injects Axe script into frames.static voidinject(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting, java.util.function.Consumer<org.openqa.selenium.WebDriver> injectCB, boolean doNotInjectAxe)Injects Axe script into frames.static voidinjectAsync(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting)Injects script into frames to be run asynchronously.
-
-
-
Method Detail
-
executeScript
public static Object executeScript(org.openqa.selenium.WebDriver webDriver, String command, Object... args)
Execute an synchronous JavaScript command.- Parameters:
webDriver- for the page to be scannedcommand- The command to be executed.args- Additional arguments to be provided to the command.- Returns:
- the results that would normally be provided to the synchronous commands callback.
-
executeAsyncScript
public static Object executeAsyncScript(org.openqa.selenium.WebDriver webDriver, String command, Object... args)
Execute an asynchronous JavaScript command.- Parameters:
webDriver- for the page to be scannedcommand- The command to be executed.args- Additional arguments to be provided to the command.- Returns:
- the results that would normally be provided to the asynchronous commands callback.
-
inject
public static void inject(org.openqa.selenium.WebDriver driver, IAxeScriptProvider scriptProvider, boolean disableIframeTesting) throws OperationNotSupportedException, IOExceptionInjects Axe script into frames. If a frame (not top-level) errors when injecting due to not being displayed, the error is ignored.- Parameters:
driver- WebDriver instance to inject intoscriptProvider- Provider that get the aXe script to injectdisableIframeTesting- Whether or not to inject intto iframes- Throws:
OperationNotSupportedException- if the operation errors outIOException- if an IO exception occurs
-
inject
public static void inject(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting)Injects Axe script into frames. If a frame (not top-level) errors when injecting due to not being displayed, the error is ignored.- Parameters:
driver- WebDriver instance to inject intoscript- The script to injectdisableIframeTesting- Whether or not to inject intto iframes
-
inject
public static void inject(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting, java.util.function.Consumer<org.openqa.selenium.WebDriver> injectCB, boolean doNotInjectAxe)Injects Axe script into frames. If a frame (not top-level) errors when injecting due to not being displayed, the error is ignored.- Parameters:
driver- WebDriver instance to inject intoscript- The script to injectdisableIframeTesting- Whether or not to inject intto iframesinjectCB- Function to call whenever a frame is injected intodoNotInjectAxe- Whether or not to inject axe
-
injectAsync
public static void injectAsync(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting)Injects script into frames to be run asynchronously.- Parameters:
driver- WebDriver instance to inject intoscript- The script to injectdisableIframeTesting- Whether or not to inject intto iframes
-
-