com.vaadin.testbench.
Class 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
-
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
ConstructorsModifierConstructorDescriptionprotected
TestBenchDriverProxy
(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
executeAsyncScript
(String script, Object... args) executeScript
(String script, Object... args) org.openqa.selenium.WebElement
findElement
(org.openqa.selenium.By arg0) List<org.openqa.selenium.WebElement>
findElements
(org.openqa.selenium.By arg0) void
org.openqa.selenium.Capabilities
Return a reference to the related
TestBenchCommandExecutor
instance.<X> X
getScreenshotAs
(org.openqa.selenium.OutputType<X> target) getTitle()
org.openqa.selenium.WebDriver
org.openqa.selenium.WebDriver.Options
manage()
org.openqa.selenium.WebDriver.Navigation
navigate()
void
quit()
org.openqa.selenium.WebDriver.TargetLocator
switchTo()
protected static Object
wrapElementOrElements
(Object elementElementsOrValues, TestBenchCommandExecutor tbCommandExecutor) Wraps any
WebElement
found inside the object inside aTestBenchElement
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods 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:
close
in interfaceorg.openqa.selenium.WebDriver
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By arg0) Specified by:
findElement
in interfaceorg.openqa.selenium.SearchContext
Specified by:
findElement
in interfaceorg.openqa.selenium.WebDriver
-
findElements
Specified by:
findElements
in interfaceorg.openqa.selenium.SearchContext
Specified by:
findElements
in interfaceorg.openqa.selenium.WebDriver
-
get
Specified by:
get
in interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
Specified by:
getCurrentUrl
in interfaceorg.openqa.selenium.WebDriver
-
getPageSource
Specified by:
getPageSource
in interfaceorg.openqa.selenium.WebDriver
-
getTitle
Specified by:
getTitle
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
Specified by:
getWindowHandle
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
Specified by:
getWindowHandles
in interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()Specified by:
manage
in interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()Specified by:
quit
in interfaceorg.openqa.selenium.WebDriver
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()Specified by:
switchTo
in interfaceorg.openqa.selenium.WebDriver
-
getCommandExecutor
Description copied from interface:
HasTestBenchCommandExecutor
Return a reference to the related
TestBenchCommandExecutor
instance.Specified by:
getCommandExecutor
in interfaceHasTestBenchCommandExecutor
Returns:
the
TestBenchCommandExecutor
instance -
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()Specified by:
getCapabilities
in interfaceorg.openqa.selenium.HasCapabilities
-
getWrappedDriver
public org.openqa.selenium.WebDriver getWrappedDriver()Specified by:
getWrappedDriver
in interfaceorg.openqa.selenium.WrapsDriver
-
wrapElementOrElements
protected static Object wrapElementOrElements(Object elementElementsOrValues, TestBenchCommandExecutor tbCommandExecutor) Wraps any
WebElement
found inside the object inside aTestBenchElement
.Traverses through any
List
found 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
, aList
ofWebElements
or something completely different.tbCommandExecutor
- theTestBenchCommandExecutor
related to the driver instanceReturns:
a new object containing the wrapped elements and other possible values
-
executeScript
Specified by:
executeScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
Specified by:
executeAsyncScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException Specified by:
getScreenshotAs
in interfaceorg.openqa.selenium.TakesScreenshot
Throws:
org.openqa.selenium.WebDriverException
-