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
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
Modifier | Constructor and Description |
---|---|
protected |
TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver,
TestBenchCommandExecutor commandExecutor) |
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 a
TestBenchElement . |
protected TestBenchDriverProxy(org.openqa.selenium.WebDriver webDriver, TestBenchCommandExecutor commandExecutor)
public void close()
close
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By arg0)
findElement
in interface org.openqa.selenium.SearchContext
findElement
in interface org.openqa.selenium.WebDriver
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By arg0)
findElements
in interface org.openqa.selenium.SearchContext
findElements
in interface org.openqa.selenium.WebDriver
public void get(String arg0)
get
in interface org.openqa.selenium.WebDriver
public String getCurrentUrl()
getCurrentUrl
in interface org.openqa.selenium.WebDriver
public String getPageSource()
getPageSource
in interface org.openqa.selenium.WebDriver
public String getTitle()
getTitle
in interface org.openqa.selenium.WebDriver
public String getWindowHandle()
getWindowHandle
in interface org.openqa.selenium.WebDriver
public Set<String> getWindowHandles()
getWindowHandles
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.Options manage()
manage
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.Navigation navigate()
navigate
in interface org.openqa.selenium.WebDriver
public void quit()
quit
in interface org.openqa.selenium.WebDriver
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
switchTo
in interface org.openqa.selenium.WebDriver
public TestBenchCommandExecutor getCommandExecutor()
HasTestBenchCommandExecutor
TestBenchCommandExecutor
instance.getCommandExecutor
in interface HasTestBenchCommandExecutor
public org.openqa.selenium.Capabilities getCapabilities()
getCapabilities
in interface org.openqa.selenium.HasCapabilities
public org.openqa.selenium.WebDriver getWrappedDriver()
getWrappedDriver
in interface org.openqa.selenium.internal.WrapsDriver
protected static Object wrapElementOrElements(Object elementElementsOrValues, TestBenchCommandExecutor tbCommandExecutor)
WebElement
found inside the object inside a
TestBenchElement
.
Traverses through any List
found inside the object and wraps any
elements inside the list, recursively. The behavior is compatible with
what executeScript(String, Object...)
and
executeAsyncScript(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.
elementElementsOrValues
- an object containing a WebElement
, a List
of
WebElements
or something completely
different.tbCommandExecutor
- the TestBenchCommandExecutor
related to the driver
instancepublic Object executeScript(String script, Object... args)
executeScript
in interface org.openqa.selenium.JavascriptExecutor
public Object executeAsyncScript(String script, Object... args)
executeAsyncScript
in interface org.openqa.selenium.JavascriptExecutor
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException
getScreenshotAs
in interface org.openqa.selenium.TakesScreenshot
org.openqa.selenium.WebDriverException
Copyright © 2019. All rights reserved.