org.jbehave.web.selenium
Class WebDriverPage

java.lang.Object
  extended by org.jbehave.web.selenium.WebDriverPage
All Implemented Interfaces:
org.openqa.selenium.HasCapabilities, org.openqa.selenium.HasInputDevices, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.SearchContext, org.openqa.selenium.WebDriver
Direct Known Subclasses:
FlashPage, FluentWebDriverPage, GroovyWebDriverPage

public abstract class WebDriverPage
extends Object
implements org.openqa.selenium.WebDriver, org.openqa.selenium.HasInputDevices, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.HasCapabilities

Abstract base class for pages that use the WebDriver API. It contains common page methods, with a view to implement the Page Objects pattern.


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
WebDriverPage(WebDriverProvider driverProvider)
           
 
Method Summary
 void close()
           
 Object executeAsyncScript(String s, Object... args)
           
 Object executeScript(String s, Object... args)
           
 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()
           
 String getCurrentUrl()
           
protected  WebDriverProvider getDriverProvider()
           
 org.openqa.selenium.Keyboard getKeyboard()
           
 org.openqa.selenium.Mouse getMouse()
           
 String getPageSource()
           
 String getTitle()
           
 String getWindowHandle()
           
 Set<String> getWindowHandles()
           
 org.openqa.selenium.WebDriver.Options manage()
           
 org.openqa.selenium.WebDriver.Navigation navigate()
           
 void quit()
           
 org.openqa.selenium.WebDriver.TargetLocator switchTo()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WebDriverPage

public WebDriverPage(WebDriverProvider driverProvider)
Method Detail

getDriverProvider

protected WebDriverProvider getDriverProvider()

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

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

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

getKeyboard

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

getMouse

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

executeScript

public Object executeScript(String s,
                            Object... args)
Specified by:
executeScript in interface org.openqa.selenium.JavascriptExecutor

executeAsyncScript

public Object executeAsyncScript(String s,
                                 Object... args)
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


Copyright © 2012. All Rights Reserved.