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.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 Description protectedTestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()ObjectexecuteAsyncScript(String script, Object... args)ObjectexecuteScript(String script, Object... args)org.openqa.selenium.WebElementfindElement(org.openqa.selenium.By arg0)List<org.openqa.selenium.WebElement>findElements(org.openqa.selenium.By arg0)voidget(String arg0)org.openqa.selenium.CapabilitiesgetCapabilities()TestBenchCommandExecutorgetCommandExecutor()Return a reference to the relatedTestBenchCommandExecutorinstance.StringgetCurrentUrl()StringgetPageSource()<X> XgetScreenshotAs(org.openqa.selenium.OutputType<X> target)StringgetTitle()StringgetWindowHandle()Set<String>getWindowHandles()org.openqa.selenium.WebDrivergetWrappedDriver()org.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.
-
-
-
Constructor Detail
-
TestBenchDriverProxy
protected TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
-
-
Method Detail
-
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
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By arg0)
- Specified by:
findElementsin interfaceorg.openqa.selenium.SearchContext- Specified by:
findElementsin interfaceorg.openqa.selenium.WebDriver
-
get
public void get(String arg0)
- Specified by:
getin interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public String getCurrentUrl()
- Specified by:
getCurrentUrlin interfaceorg.openqa.selenium.WebDriver
-
getPageSource
public String getPageSource()
- Specified by:
getPageSourcein interfaceorg.openqa.selenium.WebDriver
-
getTitle
public String getTitle()
- Specified by:
getTitlein interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public String getWindowHandle()
- Specified by:
getWindowHandlein interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
public Set<String> getWindowHandles()
- Specified by:
getWindowHandlesin interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()
- Specified by:
managein interfaceorg.openqa.selenium.WebDriver
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()
- Specified by:
navigatein 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
public TestBenchCommandExecutor getCommandExecutor()
Description copied from interface:HasTestBenchCommandExecutorReturn a reference to the relatedTestBenchCommandExecutorinstance.- Specified by:
getCommandExecutorin interfaceHasTestBenchCommandExecutor- Returns:
-
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
-
executeScript
public Object executeScript(String script, Object... args)
- Specified by:
executeScriptin interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public Object executeAsyncScript(String script, Object... args)
- 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
-
-