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 java.lang.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​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory)  
    WebDriverFacade​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, EnvironmentVariables environmentVariables)  
    WebDriverFacade​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, org.openqa.selenium.WebDriver proxiedWebDriver, java.time.Duration implicitTimeout)  
    WebDriverFacade​(org.openqa.selenium.WebDriver driver, WebDriverFactory webDriverFactory, EnvironmentVariables environmentVariables)  
  • Method Summary

    Modifier and Type Method Description
    boolean canTakeScreenshots()  
    void close()  
    java.lang.Object executeAsyncScript​(java.lang.String script, java.lang.Object... parameters)  
    java.lang.Object executeScript​(java.lang.String script, java.lang.Object... parameters)  
    org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)  
    java.util.List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)  
    void get​(java.lang.String url)  
    org.openqa.selenium.Capabilities getCapabilities()  
    java.time.Duration getCurrentImplicitTimeout()  
    java.lang.String getCurrentUrl()  
    java.lang.Class<? extends org.openqa.selenium.WebDriver> getDriverClass()  
    protected org.openqa.selenium.WebDriver getDriverInstance()  
    java.lang.String getDriverName()  
    org.openqa.selenium.interactions.Keyboard getKeyboard()  
    org.openqa.selenium.interactions.Mouse getMouse()  
    java.lang.String getPageSource()  
    org.openqa.selenium.WebDriver getProxiedDriver()  
    <X> X getScreenshotAs​(org.openqa.selenium.OutputType<X> target)  
    java.lang.String getTitle()  
    java.lang.String getWindowHandle()  
    java.util.Set<java.lang.String> getWindowHandles()  
    boolean isAProxyFor​(java.lang.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​(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)  
    protected boolean proxyInstanciated()  
    void quit()  
    void reset()  
    void resetInputState()  
    java.time.Duration resetTimeouts()  
    void setImplicitTimeout​(java.time.Duration implicitTimeout)  
    org.openqa.selenium.WebDriver.TargetLocator switchTo()  
    java.lang.String toString()  
    WebDriverFacade withOptions​(java.lang.String options)  
    WebDriverFacade withTimeoutOf​(java.time.Duration implicitTimeout)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

    • proxiedWebDriver

      protected org.openqa.selenium.WebDriver proxiedWebDriver
  • Constructor Details

    • WebDriverFacade

      public WebDriverFacade​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory)
    • WebDriverFacade

      public WebDriverFacade​(java.lang.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​(java.lang.Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory, org.openqa.selenium.WebDriver proxiedWebDriver, java.time.Duration implicitTimeout)
  • Method Details

    • withTimeoutOf

      public WebDriverFacade withTimeoutOf​(java.time.Duration implicitTimeout)
    • getDriverClass

      public java.lang.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 interface org.openqa.selenium.TakesScreenshot
    • get

      public void get​(java.lang.String url)
      Specified by:
      get in interface org.openqa.selenium.WebDriver
    • getCurrentUrl

      public java.lang.String getCurrentUrl()
      Specified by:
      getCurrentUrl in interface org.openqa.selenium.WebDriver
    • getTitle

      public java.lang.String getTitle()
      Specified by:
      getTitle in interface org.openqa.selenium.WebDriver
    • findElements

      public java.util.List<org.openqa.selenium.WebElement> findElements​(org.openqa.selenium.By by)
      Specified by:
      findElements in interface org.openqa.selenium.SearchContext
      Specified by:
      findElements in interface org.openqa.selenium.WebDriver
    • findElement

      public org.openqa.selenium.WebElement findElement​(org.openqa.selenium.By by)
      Specified by:
      findElement in interface org.openqa.selenium.SearchContext
      Specified by:
      findElement in interface org.openqa.selenium.WebDriver
    • getPageSource

      public java.lang.String getPageSource()
      Specified by:
      getPageSource in interface org.openqa.selenium.WebDriver
    • setImplicitTimeout

      public void setImplicitTimeout​(java.time.Duration implicitTimeout)
      Specified by:
      setImplicitTimeout in interface ConfigurableTimeouts
    • getCurrentImplicitTimeout

      public java.time.Duration getCurrentImplicitTimeout()
      Specified by:
      getCurrentImplicitTimeout in interface ConfigurableTimeouts
    • resetTimeouts

      public java.time.Duration resetTimeouts()
      Specified by:
      resetTimeouts in interface ConfigurableTimeouts
    • getDriverInstance

      protected org.openqa.selenium.WebDriver getDriverInstance()
    • close

      public void close()
      Specified by:
      close in interface org.openqa.selenium.WebDriver
    • quit

      public void quit()
      Specified by:
      quit in interface org.openqa.selenium.WebDriver
    • proxyInstanciated

      protected boolean proxyInstanciated()
    • getWindowHandles

      public java.util.Set<java.lang.String> getWindowHandles()
      Specified by:
      getWindowHandles in interface org.openqa.selenium.WebDriver
    • getWindowHandle

      public java.lang.String getWindowHandle()
      Specified by:
      getWindowHandle in interface org.openqa.selenium.WebDriver
    • switchTo

      public org.openqa.selenium.WebDriver.TargetLocator switchTo()
      Specified by:
      switchTo in interface org.openqa.selenium.WebDriver
    • manage

      public org.openqa.selenium.WebDriver.Options manage()
      Specified by:
      manage in interface org.openqa.selenium.WebDriver
    • canTakeScreenshots

      public boolean canTakeScreenshots()
    • isInstantiated

      public boolean isInstantiated()
    • getKeyboard

      public org.openqa.selenium.interactions.Keyboard getKeyboard()
      Specified by:
      getKeyboard in interface org.openqa.selenium.interactions.HasInputDevices
    • getMouse

      public org.openqa.selenium.interactions.Mouse getMouse()
      Specified by:
      getMouse in interface org.openqa.selenium.interactions.HasInputDevices
    • executeScript

      public java.lang.Object executeScript​(java.lang.String script, java.lang.Object... parameters)
      Specified by:
      executeScript in interface org.openqa.selenium.JavascriptExecutor
    • executeAsyncScript

      public java.lang.Object executeAsyncScript​(java.lang.String script, java.lang.Object... parameters)
      Specified by:
      executeAsyncScript in interface org.openqa.selenium.JavascriptExecutor
    • getCapabilities

      public org.openqa.selenium.Capabilities getCapabilities()
      Specified by:
      getCapabilities in interface org.openqa.selenium.HasCapabilities
    • getDriverName

      public java.lang.String getDriverName()
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object
    • withOptions

      public WebDriverFacade withOptions​(java.lang.String options)
    • isAProxyFor

      public boolean isAProxyFor​(java.lang.Class<? extends org.openqa.selenium.WebDriver> somedriverClass)
    • isDisabled

      public boolean isDisabled()
    • perform

      public void perform​(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)
      Specified by:
      perform in interface org.openqa.selenium.interactions.Interactive
    • resetInputState

      public void resetInputState()
      Specified by:
      resetInputState in interface org.openqa.selenium.interactions.Interactive