Class EventFiringWebDriver
- java.lang.Object
-
- org.openqa.selenium.support.events.EventFiringWebDriver
-
- All Implemented Interfaces:
org.openqa.selenium.HasCapabilities
,org.openqa.selenium.interactions.HasInputDevices
,org.openqa.selenium.interactions.HasTouchScreen
,org.openqa.selenium.interactions.Interactive
,org.openqa.selenium.JavascriptExecutor
,org.openqa.selenium.SearchContext
,org.openqa.selenium.TakesScreenshot
,org.openqa.selenium.WebDriver
,org.openqa.selenium.WrapsDriver
public class EventFiringWebDriver extends java.lang.Object implements org.openqa.selenium.WebDriver, org.openqa.selenium.JavascriptExecutor, org.openqa.selenium.TakesScreenshot, org.openqa.selenium.WrapsDriver, org.openqa.selenium.interactions.HasInputDevices, org.openqa.selenium.interactions.HasTouchScreen, org.openqa.selenium.interactions.Interactive, org.openqa.selenium.HasCapabilities
A wrapper around an arbitraryWebDriver
instance which supports registering of aWebDriverEventListener
, e.g. for logging purposes.
-
-
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
Constructors Constructor Description EventFiringWebDriver(org.openqa.selenium.WebDriver driver)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
java.lang.Object
executeAsyncScript(java.lang.String script, java.lang.Object... args)
java.lang.Object
executeScript(java.lang.String script, java.lang.Object... args)
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.lang.String
getCurrentUrl()
org.openqa.selenium.interactions.Keyboard
getKeyboard()
org.openqa.selenium.interactions.Mouse
getMouse()
java.lang.String
getPageSource()
<X> X
getScreenshotAs(org.openqa.selenium.OutputType<X> target)
java.lang.String
getTitle()
org.openqa.selenium.interactions.TouchScreen
getTouch()
java.lang.String
getWindowHandle()
java.util.Set<java.lang.String>
getWindowHandles()
org.openqa.selenium.WebDriver
getWrappedDriver()
org.openqa.selenium.WebDriver.Options
manage()
org.openqa.selenium.WebDriver.Navigation
navigate()
void
perform(java.util.Collection<org.openqa.selenium.interactions.Sequence> actions)
void
quit()
EventFiringWebDriver
register(WebDriverEventListener eventListener)
void
resetInputState()
org.openqa.selenium.WebDriver.TargetLocator
switchTo()
EventFiringWebDriver
unregister(WebDriverEventListener eventListener)
-
-
-
Method Detail
-
register
public EventFiringWebDriver register(WebDriverEventListener eventListener)
- Parameters:
eventListener
- the event listener to register- Returns:
- this for method chaining.
-
unregister
public EventFiringWebDriver unregister(WebDriverEventListener eventListener)
- Parameters:
eventListener
- the event listener to unregister- Returns:
- this for method chaining.
-
getWrappedDriver
public org.openqa.selenium.WebDriver getWrappedDriver()
- Specified by:
getWrappedDriver
in interfaceorg.openqa.selenium.WrapsDriver
-
get
public void get(java.lang.String url)
- Specified by:
get
in interfaceorg.openqa.selenium.WebDriver
-
getCurrentUrl
public java.lang.String getCurrentUrl()
- Specified by:
getCurrentUrl
in interfaceorg.openqa.selenium.WebDriver
-
getTitle
public java.lang.String getTitle()
- Specified by:
getTitle
in interfaceorg.openqa.selenium.WebDriver
-
findElements
public java.util.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 java.lang.String getPageSource()
- Specified by:
getPageSource
in interfaceorg.openqa.selenium.WebDriver
-
close
public void close()
- Specified by:
close
in interfaceorg.openqa.selenium.WebDriver
-
quit
public void quit()
- Specified by:
quit
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandles
public java.util.Set<java.lang.String> getWindowHandles()
- Specified by:
getWindowHandles
in interfaceorg.openqa.selenium.WebDriver
-
getWindowHandle
public java.lang.String getWindowHandle()
- Specified by:
getWindowHandle
in interfaceorg.openqa.selenium.WebDriver
-
executeScript
public java.lang.Object executeScript(java.lang.String script, java.lang.Object... args)
- Specified by:
executeScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
executeAsyncScript
public java.lang.Object executeAsyncScript(java.lang.String script, java.lang.Object... args)
- Specified by:
executeAsyncScript
in interfaceorg.openqa.selenium.JavascriptExecutor
-
getScreenshotAs
public <X> X getScreenshotAs(org.openqa.selenium.OutputType<X> target) throws org.openqa.selenium.WebDriverException
- Specified by:
getScreenshotAs
in interfaceorg.openqa.selenium.TakesScreenshot
- Throws:
org.openqa.selenium.WebDriverException
-
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
-
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
-
getTouch
public org.openqa.selenium.interactions.TouchScreen getTouch()
- Specified by:
getTouch
in interfaceorg.openqa.selenium.interactions.HasTouchScreen
-
perform
public void perform(java.util.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
-
getCapabilities
public org.openqa.selenium.Capabilities getCapabilities()
- Specified by:
getCapabilities
in interfaceorg.openqa.selenium.HasCapabilities
-
-