net.thucydides.core.webdriver
Class WebDriverFacade

Package class diagram package WebDriverFacade
java.lang.Object
  extended by net.thucydides.core.webdriver.WebDriverFacade
All Implemented Interfaces:
org.openqa.selenium.interactions.HasInputDevices, 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

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
protected  org.openqa.selenium.WebDriver proxiedWebDriver
           
 
Constructor Summary
WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass, WebDriverFactory webDriverFactory)
           
 
Method Summary
 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)
           
 String getCurrentUrl()
           
 Class<? extends org.openqa.selenium.WebDriver> getDriverClass()
           
protected  org.openqa.selenium.WebDriver getDriverInstance()
           
 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 isEnabled()
           
 boolean isInstantiated()
           
 org.openqa.selenium.WebDriver.Options manage()
           
 org.openqa.selenium.WebDriver.Navigation navigate()
           
protected  org.openqa.selenium.WebDriver newProxyDriver()
           
protected  boolean proxyInstanciated()
           
 void quit()
           
 void reset()
           
 org.openqa.selenium.WebDriver.TargetLocator switchTo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

proxiedWebDriver

protected org.openqa.selenium.WebDriver proxiedWebDriver
Constructor Detail

WebDriverFacade

public WebDriverFacade(Class<? extends org.openqa.selenium.WebDriver> driverClass,
                       WebDriverFactory webDriverFactory)
Method Detail

getDriverClass

public Class<? extends org.openqa.selenium.WebDriver> getDriverClass()

getProxiedDriver

public org.openqa.selenium.WebDriver getProxiedDriver()

isEnabled

public boolean isEnabled()

reset

public void reset()

newProxyDriver

protected org.openqa.selenium.WebDriver newProxyDriver()

getScreenshotAs

public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target)
Specified by:
getScreenshotAs in interface org.openqa.selenium.TakesScreenshot

get

public void get(String url)
Specified by:
get in interface org.openqa.selenium.WebDriver

getCurrentUrl

public String getCurrentUrl()
Specified by:
getCurrentUrl in interface org.openqa.selenium.WebDriver

getTitle

public String getTitle()
Specified by:
getTitle in interface org.openqa.selenium.WebDriver

findElements

public 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 String getPageSource()
Specified by:
getPageSource in interface org.openqa.selenium.WebDriver

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 Set<String> getWindowHandles()
Specified by:
getWindowHandles in interface org.openqa.selenium.WebDriver

getWindowHandle

public 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

navigate

public org.openqa.selenium.WebDriver.Navigation navigate()
Specified by:
navigate 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 Object executeScript(String script,
                            Object... parameters)
Specified by:
executeScript in interface org.openqa.selenium.JavascriptExecutor

executeAsyncScript

public Object executeAsyncScript(String script,
                                 Object... parameters)
Specified by:
executeAsyncScript in interface org.openqa.selenium.JavascriptExecutor


Copyright © 2011-2013 Wakaleo Consulting. All Rights Reserved.