com.vaadin.testbench.
Class TestBenchDriverProxy
- java.lang.Object
-
- com.vaadin.testbench.TestBenchDriverProxy
-
All Implemented Interfaces:
HasTestBenchCommandExecutor, org.openqa.selenium.HasCapabilities, org.openqa.selenium.internal.WrapsDriver, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WebDriver
public class TestBenchDriverProxy extends Object implements org.openqa.selenium.WebDriver, org.openqa.selenium.internal.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.ImeHandler, 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
Constructors Modifier Constructor and Description protected
TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
-
Method Summary
All Methods Modifier and Type Method and Description void
close()
Object
executeAsyncScript(String script, Object... args)
Object
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
get(String arg0)
org.openqa.selenium.Capabilities
getCapabilities()
TestBenchCommandExecutor
getCommandExecutor()
Return a reference to the related
TestBenchCommandExecutor
instance.String
getCurrentUrl()
String
getPageSource()
<X> X
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
String
getTitle()
String
getWindowHandle()
Set<String>
getWindowHandles()
org.openqa.selenium.WebDriver
getWrappedDriver()
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
.
-
-
-
Constructor Detail
-
TestBenchDriverProxy
protected TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
-
-
Method Detail
-
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
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By arg0)
Specified by:
findElements
in interfaceorg.openqa.selenium.SearchContext
Specified by:
findElements
in interfaceorg.openqa.selenium.WebDriver
-
get
public void get(String arg0)
Specified by:
get
in interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public String getCurrentUrl()
Specified by:
getCurrentUrl
in interfaceorg.openqa.selenium.WebDriver
-
getPageSource
public String getPageSource()
Specified by:
getPageSource
in interfaceorg.openqa.selenium.WebDriver
-
getTitle
public String getTitle()
Specified by:
getTitle
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public String getWindowHandle()
Specified by:
getWindowHandle
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
public Set<String> 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
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()
Specified by:
navigate
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
public TestBenchCommandExecutor getCommandExecutor()
Description copied from interface:
HasTestBenchCommandExecutor
Return a reference to the related
TestBenchCommandExecutor
instance.Specified by:
getCommandExecutor
in interfaceHasTestBenchCommandExecutor
Returns:
-
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.internal.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 instance
-
executeScript
public Object executeScript(String script, Object... args)
Specified by:
executeScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public Object executeAsyncScript(String script, Object... args)
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
-
-