Class BaseAugmenter

  • Direct Known Subclasses:
    Augmenter, JdkAugmenter

    public abstract class BaseAugmenter
    extends java.lang.Object
    Enhance the interfaces implemented by an instance of the RemoteWebDriver based on the returned Capabilities of the driver. Note: this class is still experimental. Use at your own risk.
    • Constructor Summary

      Constructors 
      Constructor Description
      BaseAugmenter()  
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void addDriverAugmentation​(java.lang.String capabilityName, AugmenterProvider handlerClass)
      Add a mapping between a capability name and the implementation of the interface that name represents for instances of WebDriver.
      void addElementAugmentation​(java.lang.String capabilityName, AugmenterProvider handlerClass)
      Add a mapping between a capability name and the implementation of the interface that name represents for instances of WebElement.
      org.openqa.selenium.WebElement augment​(RemoteWebElement element)
      Enhance the interfaces implemented by this instance of WebElement iff that instance is a RemoteWebElement.
      org.openqa.selenium.WebDriver augment​(org.openqa.selenium.WebDriver driver)
      Enhance the interfaces implemented by this instance of WebDriver iff that instance is a RemoteWebDriver.
      protected abstract <X> X create​(RemoteWebDriver driver, java.util.Map<java.lang.String,​AugmenterProvider> augmentors, X objectToAugment)
      Subclasses should perform the requested augmentation.
      protected abstract RemoteWebDriver extractRemoteWebDriver​(org.openqa.selenium.WebDriver driver)
      Subclasses should extract the remote webdriver or return null if it can't extract it.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BaseAugmenter

        public BaseAugmenter()
    • Method Detail

      • addDriverAugmentation

        public void addDriverAugmentation​(java.lang.String capabilityName,
                                          AugmenterProvider handlerClass)
        Add a mapping between a capability name and the implementation of the interface that name represents for instances of WebDriver.

        Note: This method is still experimental. Use at your own risk.

        Parameters:
        capabilityName - The name of the capability to model
        handlerClass - The provider of the interface and implementation
      • addElementAugmentation

        public void addElementAugmentation​(java.lang.String capabilityName,
                                           AugmenterProvider handlerClass)
        Add a mapping between a capability name and the implementation of the interface that name represents for instances of WebElement.

        Note: This method is still experimental. Use at your own risk.

        Parameters:
        capabilityName - The name of the capability to model
        handlerClass - The provider of the interface and implementation
      • augment

        public org.openqa.selenium.WebDriver augment​(org.openqa.selenium.WebDriver driver)
        Enhance the interfaces implemented by this instance of WebDriver iff that instance is a RemoteWebDriver. The WebDriver that is returned may well be a dynamic proxy. You cannot rely on the concrete implementing class to remain constant.
        Parameters:
        driver - The driver to enhance
        Returns:
        A class implementing the described interfaces.
      • augment

        public org.openqa.selenium.WebElement augment​(RemoteWebElement element)
        Enhance the interfaces implemented by this instance of WebElement iff that instance is a RemoteWebElement. The WebElement that is returned may well be a dynamic proxy. You cannot rely on the concrete implementing class to remain constant.
        Parameters:
        element - The driver to enhance.
        Returns:
        A class implementing the described interfaces.
      • create

        protected abstract <X> X create​(RemoteWebDriver driver,
                                        java.util.Map<java.lang.String,​AugmenterProvider> augmentors,
                                        X objectToAugment)
        Subclasses should perform the requested augmentation.
        Type Parameters:
        X - typically a RemoteWebDriver or RemoteWebElement
        Parameters:
        augmentors - augumentors to augment the object
        driver - RWD instance
        objectToAugment - object to augment
        Returns:
        an augmented version of objectToAugment.
      • extractRemoteWebDriver

        protected abstract RemoteWebDriver extractRemoteWebDriver​(org.openqa.selenium.WebDriver driver)
        Subclasses should extract the remote webdriver or return null if it can't extract it.
        Parameters:
        driver - WebDriver instance to extract
        Returns:
        extracted RemoteWebDriver or null