Package net.thucydides.core.webdriver
Class WebDriverFacade
- java.lang.Object
-
- net.thucydides.core.webdriver.WebDriverFacade
-
- All Implemented Interfaces:
ConfigurableTimeouts
,org.openqa.selenium.HasCapabilities
,org.openqa.selenium.interactions.HasInputDevices
,org.openqa.selenium.interactions.Interactive
,org.openqa.selenium.JavascriptExecutor
,org.openqa.selenium.SearchContext
,org.openqa.selenium.TakesScreenshot
,org.openqa.selenium.WebDriver
public class WebDriverFacade extends Object implements org.openqa.selenium.WebDriver, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.HasCapabilities, ConfigurableTimeouts, org.openqa.selenium.interactions.Interactive
A proxy class for webdriver instances, designed to prevent the browser being opened unnecessarily.
-
-
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
-
-
Field Summary
Fields Modifier and Type Field Description protected org.openqa.selenium.WebDriver
proxiedWebDriver
-
Constructor Summary
Constructors Constructor Description WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory)
WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, EnvironmentVariables environmentVariables)
WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, org.openqa.selenium.WebDriver proxiedWebDriver, Duration implicitTimeout)
WebDriverFacade(org.openqa.selenium.WebDriver driver, WebDriverFactory webDriverFactory, EnvironmentVariables environmentVariables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canTakeScreenshots()
void
close()
Object
executeAsyncScript(String script, Object... parameters)
Object
executeScript(String script, Object... parameters)
org.openqa.selenium.WebElement
findElement(org.openqa.selenium.By by)
List<org.openqa.selenium.WebElement>
findElements(org.openqa.selenium.By by)
void
get(String url)
org.openqa.selenium.Capabilities
getCapabilities()
Duration
getCurrentImplicitTimeout()
String
getCurrentUrl()
Class<? extends org.openqa.selenium.WebDriver>
getDriverClass()
protected org.openqa.selenium.WebDriver
getDriverInstance()
String
getDriverName()
org.openqa.selenium.interactions.Keyboard
getKeyboard()
org.openqa.selenium.interactions.Mouse
getMouse()
String
getPageSource()
org.openqa.selenium.WebDriver
getProxiedDriver()
<X> X
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
String
getTitle()
String
getWindowHandle()
Set<String>
getWindowHandles()
boolean
isAProxyFor(Class<? extends org.openqa.selenium.WebDriver> somedriverClass)
boolean
isDisabled()
boolean
isEnabled()
boolean
isInstantiated()
org.openqa.selenium.WebDriver.Options
manage()
org.openqa.selenium.WebDriver.Navigation
navigate()
void
perform(Collection<org.openqa.selenium.interactions.Sequence> actions)
protected boolean
proxyInstanciated()
void
quit()
void
reset()
void
resetInputState()
Duration
resetTimeouts()
void
setImplicitTimeout(Duration implicitTimeout)
org.openqa.selenium.WebDriver.TargetLocator
switchTo()
String
toString()
WebDriverFacade
withOptions(String options)
WebDriverFacade
withTimeoutOf(Duration implicitTimeout)
-
-
-
Constructor Detail
-
WebDriverFacade
public WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory)
-
WebDriverFacade
public WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, EnvironmentVariables environmentVariables)
-
WebDriverFacade
public WebDriverFacade(org.openqa.selenium.WebDriver driver, WebDriverFactory webDriverFactory, EnvironmentVariables environmentVariables)
-
WebDriverFacade
public WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, org.openqa.selenium.WebDriver proxiedWebDriver, Duration implicitTimeout)
-
-
Method Detail
-
withTimeoutOf
public WebDriverFacade withTimeoutOf(Duration implicitTimeout)
-
getDriverClass
public Class<? extends org.openqa.selenium.WebDriver> getDriverClass()
-
getProxiedDriver
public org.openqa.selenium.WebDriver getProxiedDriver()
-
isEnabled
public boolean isEnabled()
-
reset
public void reset()
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
- Specified by:
getScreenshotAs
in interfaceorg.openqa.selenium.TakesScreenshot
-
get
public void get(String url)
- Specified by:
get
in interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public String getCurrentUrl()
- Specified by:
getCurrentUrl
in interfaceorg.openqa.selenium.WebDriver
-
getTitle
public String getTitle()
- Specified by:
getTitle
in interfaceorg.openqa.selenium.WebDriver
-
findElements
public List<org.openqa.selenium.WebElement> findElements(org.openqa.selenium.By by)
- Specified by:
findElements
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElements
in interfaceorg.openqa.selenium.WebDriver
-
findElement
public org.openqa.selenium.WebElement findElement(org.openqa.selenium.By by)
- Specified by:
findElement
in interfaceorg.openqa.selenium.SearchContext
- Specified by:
findElement
in interfaceorg.openqa.selenium.WebDriver
-
getPageSource
public String getPageSource()
- Specified by:
getPageSource
in interfaceorg.openqa.selenium.WebDriver
-
setImplicitTimeout
public void setImplicitTimeout(Duration implicitTimeout)
- Specified by:
setImplicitTimeout
in interfaceConfigurableTimeouts
-
getCurrentImplicitTimeout
public Duration getCurrentImplicitTimeout()
- Specified by:
getCurrentImplicitTimeout
in interfaceConfigurableTimeouts
-
resetTimeouts
public Duration resetTimeouts()
- Specified by:
resetTimeouts
in interfaceConfigurableTimeouts
-
getDriverInstance
protected org.openqa.selenium.WebDriver getDriverInstance()
-
close
public void close()
- Specified by:
close
in interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()
- Specified by:
quit
in interfaceorg.openqa.selenium.WebDriver
-
proxyInstanciated
protected boolean proxyInstanciated()
-
getWindowHandles
public Set<String> getWindowHandles()
- Specified by:
getWindowHandles
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public String getWindowHandle()
- Specified by:
getWindowHandle
in interfaceorg.openqa.selenium.WebDriver
-
switchTo
public org.openqa.selenium.WebDriver.TargetLocator switchTo()
- Specified by:
switchTo
in interfaceorg.openqa.selenium.WebDriver
-
navigate
public org.openqa.selenium.WebDriver.Navigation navigate()
- Specified by:
navigate
in interfaceorg.openqa.selenium.WebDriver
-
manage
public org.openqa.selenium.WebDriver.Options manage()
- Specified by:
manage
in interfaceorg.openqa.selenium.WebDriver
-
canTakeScreenshots
public boolean canTakeScreenshots()
-
isInstantiated
public boolean isInstantiated()
-
getKeyboard
public org.openqa.selenium.interactions.Keyboard getKeyboard()
- Specified by:
getKeyboard
in interfaceorg.openqa.selenium.interactions.HasInputDevices
-
getMouse
public org.openqa.selenium.interactions.Mouse getMouse()
- Specified by:
getMouse
in interfaceorg.openqa.selenium.interactions.HasInputDevices
-
executeScript
public Object executeScript(String script, Object... parameters)
- Specified by:
executeScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public Object executeAsyncScript(String script, Object... parameters)
- Specified by:
executeAsyncScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()
- Specified by:
getCapabilities
in interfaceorg.openqa.selenium.HasCapabilities
-
getDriverName
public String getDriverName()
-
withOptions
public WebDriverFacade withOptions(String options)
-
isAProxyFor
public boolean isAProxyFor(Class<? extends org.openqa.selenium.WebDriver> somedriverClass)
-
isDisabled
public boolean isDisabled()
-
perform
public void perform(Collection<org.openqa.selenium.interactions.Sequence> actions)
- Specified by:
perform
in interfaceorg.openqa.selenium.interactions.Interactive
-
resetInputState
public void resetInputState()
- Specified by:
resetInputState
in interfaceorg.openqa.selenium.interactions.Interactive
-
-