Package com.vaadin.testbench
Class TestBenchDriverProxy
java.lang.Object
com.vaadin.testbench.TestBenchDriverProxy
- All Implemented Interfaces:
HasTestBenchCommandExecutor,org.openqa.selenium.HasCapabilities,org.openqa.selenium.JavascriptExecutor,org.openqa.selenium.SearchContext,org.openqa.selenium.TakesScreenshot,org.openqa.selenium.WebDriver,org.openqa.selenium.WrapsDriver
public class TestBenchDriverProxy
extends Object
implements org.openqa.selenium.WebDriver, org.openqa.selenium.WrapsDriver, HasTestBenchCommandExecutor, org.openqa.selenium.HasCapabilities, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.JavascriptExecutor
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openqa.selenium.WebDriver
org.openqa.selenium.WebDriver.Navigation, org.openqa.selenium.WebDriver.Options, org.openqa.selenium.WebDriver.TargetLocator, org.openqa.selenium.WebDriver.Timeouts, org.openqa.selenium.WebDriver.Window -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedTestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()executeAsyncScript(String script, Object... args) executeScript(String script, Object... args) org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By arg0) List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By arg0) voidorg.openqa.selenium.CapabilitiesReturn a reference to the relatedTestBenchCommandExecutorinstance.<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> target) getTitle()org.openqa.selenium.WebDriverorg.openqa.selenium.WebDriver.Optionsmanage()org.openqa.selenium.WebDriver.Navigationnavigate()voidquit()org.openqa.selenium.WebDriver.TargetLocatorswitchTo()protected static ObjectwrapElementOrElements(Object elementElementsOrValues, TestBenchCommandExecutor tbCommandExecutor) Wraps anyWebElementfound inside the object inside aTestBenchElement.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openqa.selenium.JavascriptExecutor
executeScript, getPinnedScripts, pin, unpin
-
Constructor Details
-
TestBenchDriverProxy
protected TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
-
-
Method Details
-
close
public void close()- Specified by:
closein interfaceorg.openqa.selenium.WebDriver
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By arg0) - Specified by:
findElementin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementin interfaceorg.openqa.selenium.WebDriver
-
findElements
- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebDriver
-
get
- Specified by:
getin interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
- Specified by:
getCurrentUrlin interfaceorg.openqa.selenium.WebDriver
-
getPageSource
- Specified by:
getPageSourcein interfaceorg.openqa.selenium.WebDriver
-
getTitle
- Specified by:
getTitlein interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
- Specified by:
getWindowHandlein interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
- Specified by:
getWindowHandlesin interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()- Specified by:
managein interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()- Specified by:
quitin interfaceorg.openqa.selenium.WebDriver
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()- Specified by:
switchToin interfaceorg.openqa.selenium.WebDriver
-
getCommandExecutor
Description copied from interface:HasTestBenchCommandExecutorReturn a reference to the relatedTestBenchCommandExecutorinstance.- Specified by:
getCommandExecutorin interfaceHasTestBenchCommandExecutor- Returns:
- the
TestBenchCommandExecutorinstance
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()- Specified by:
getCapabilitiesin interfaceorg.openqa.selenium.HasCapabilities
-
getWrappedDriver
public org.openqa.selenium.WebDriver getWrappedDriver()- Specified by:
getWrappedDriverin interfaceorg.openqa.selenium.WrapsDriver
-
wrapElementOrElements
protected static Object wrapElementOrElements(Object elementElementsOrValues, TestBenchCommandExecutor tbCommandExecutor) Wraps anyWebElementfound inside the object inside aTestBenchElement.Traverses through any
Listfound inside the object and wraps any elements inside the list, recursively. The behavior is compatible with whatexecuteScript(String, Object...)andexecuteAsyncScript(String, Object...)returns.Does not modify the argument, instead creates a new object containing the wrapped elements and other possible values.
This method is protected for testing purposes only.
- Parameters:
elementElementsOrValues- an object containing aWebElement, aListofWebElementsor something completely different.tbCommandExecutor- theTestBenchCommandExecutorrelated to the driver instance- Returns:
- a new object containing the wrapped elements and other possible values
-
executeScript
- Specified by:
executeScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
- Specified by:
executeAsyncScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException - Specified by:
getScreenshotAsin interfaceorg.openqa.selenium.TakesScreenshot- Throws:
org.openqa.selenium.WebDriverException
-