Package org.openqa.selenium.remote
Class BaseAugmenter
- java.lang.Object
-
- org.openqa.selenium.remote.BaseAugmenter
-
- Direct Known Subclasses:
Augmenter
,JdkAugmenter
public abstract class BaseAugmenter extends java.lang.Object
Enhance the interfaces implemented by an instance of theRemoteWebDriver
based on the returnedCapabilities
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 ofWebDriver
.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 ofWebElement
.org.openqa.selenium.WebElement
augment(RemoteWebElement element)
Enhance the interfaces implemented by this instance of WebElement iff that instance is aRemoteWebElement
.org.openqa.selenium.WebDriver
augment(org.openqa.selenium.WebDriver driver)
Enhance the interfaces implemented by this instance of WebDriver iff that instance is aRemoteWebDriver
.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.
-
-
-
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 ofWebDriver
.Note: This method is still experimental. Use at your own risk.
- Parameters:
capabilityName
- The name of the capability to modelhandlerClass
- 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 ofWebElement
.Note: This method is still experimental. Use at your own risk.
- Parameters:
capabilityName
- The name of the capability to modelhandlerClass
- 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 aRemoteWebDriver
. 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 aRemoteWebElement
. 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 objectdriver
- RWD instanceobjectToAugment
- 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
-
-