Class 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 Object executeAsyncScript​(org.openqa.selenium.WebDriver webDriver, String command, Object... args)
      Execute an asynchronous JavaScript command.
      static Object executeScript​(org.openqa.selenium.WebDriver webDriver, String command, Object... args)
      Execute an synchronous JavaScript command.
      static void inject​(org.openqa.selenium.WebDriver driver, IAxeScriptProvider scriptProvider, boolean disableIframeTesting)
      Injects Axe script into frames.
      static void inject​(org.openqa.selenium.WebDriver driver, String script, boolean disableIframeTesting)
      Injects Axe script into frames.
      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.
      static void injectAsync​(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 scanned
        command - 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 scanned
        command - 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,
                                  IOException
        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 into
        scriptProvider - Provider that get the aXe script to inject
        disableIframeTesting - Whether or not to inject intto iframes
        Throws:
        OperationNotSupportedException - if the operation errors out
        IOException - 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 into
        script - The script to inject
        disableIframeTesting - 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 into
        script - The script to inject
        disableIframeTesting - Whether or not to inject intto iframes
        injectCB - Function to call whenever a frame is injected into
        doNotInjectAxe - 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 into
        script - The script to inject
        disableIframeTesting - Whether or not to inject intto iframes