Package io.fluentlenium.core.events
Class EventsSupport
java.lang.Object
io.fluentlenium.core.events.EventsSupport
- All Implemented Interfaces:
EventListener
EventsSupport can be registered in Selenium
EventFiringWebDriver
to
provide an
easier to use events interface.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
afterAlertAccept
(org.openqa.selenium.WebDriver driver) Called afterAlert.accept()
void
afterAlertDismiss
(org.openqa.selenium.WebDriver driver) Called afterAlert.dismiss()
void
afterChangeValueOf
(FluentWebElement element, org.openqa.selenium.WebDriver driver, CharSequence[] charSequence) Called afterWebElement.clear()
,WebElement.sendKeys(java.lang.CharSequence...)
,WebElement.sendKeys(CharSequence...)
.void
afterClickOn
(FluentWebElement element, org.openqa.selenium.WebDriver driver) Called afterWebElement.click()
.void
afterFindBy
(org.openqa.selenium.By by, FluentWebElement element, org.openqa.selenium.WebDriver driver) Called afterWebDriver.findElement(...)
,WebDriver.findElements(...)
,WebElement.findElement(...)
,WebElement.findElements(...)
.<X> void
afterGetScreenshotAs
(org.openqa.selenium.OutputType<X> outputType, X x) Called afterTakesScreenshot.getScreenshotAs(OutputType)
()}void
afterGetText
(FluentWebElement webElement, org.openqa.selenium.WebDriver webDriver, String s) Called afterWebElement.getText()
()}void
afterNavigateBack
(org.openqa.selenium.WebDriver driver) Called afternavigate().back()
.void
afterNavigateForward
(org.openqa.selenium.WebDriver driver) Called afternavigate().forward()
.void
afterNavigateRefresh
(org.openqa.selenium.WebDriver driver) Called afternavigate().refresh()
.void
afterNavigateTo
(String url, org.openqa.selenium.WebDriver driver) Called afterget(String url)
,navigate().to(String url)
.void
afterScript
(String script, org.openqa.selenium.WebDriver driver) Called afterJavascriptExecutor.executeScript(String, Object[])
.void
afterSwitchToWindow
(String s, org.openqa.selenium.WebDriver webDriver) Called afterWebDriver.switchTo()
()}void
beforeAlertAccept
(org.openqa.selenium.WebDriver driver) Called beforeAlert.accept()
void
beforeAlertDismiss
(org.openqa.selenium.WebDriver driver) Called beforeAlert.dismiss()
void
beforeChangeValueOf
(FluentWebElement element, org.openqa.selenium.WebDriver driver, CharSequence[] charSequence) Called beforeWebElement.clear()
,WebElement.sendKeys(java.lang.CharSequence...)
,WebElement.sendKeys(CharSequence...)
.void
beforeClickOn
(FluentWebElement element, org.openqa.selenium.WebDriver driver) Called beforeWebElement.click()
.void
beforeFindBy
(org.openqa.selenium.By by, FluentWebElement element, org.openqa.selenium.WebDriver driver) Called beforeWebDriver.findElement(...)
,WebDriver.findElements(...)
,WebElement.findElement(...)
,#findElement WebElement.findElements(...)
.<X> void
beforeGetScreenshotAs
(org.openqa.selenium.OutputType<X> outputType) Called beforeTakesScreenshot.getScreenshotAs(OutputType)
()}void
beforeGetText
(FluentWebElement webElement, org.openqa.selenium.WebDriver webDriver) Called beforeWebElement.getText()
()}void
beforeNavigateBack
(org.openqa.selenium.WebDriver driver) Called beforenavigate().back()
.void
beforeNavigateForward
(org.openqa.selenium.WebDriver driver) Called beforenavigate().forward()
.void
beforeNavigateRefresh
(org.openqa.selenium.WebDriver driver) Called beforenavigate().refresh()
.void
beforeNavigateTo
(String url, org.openqa.selenium.WebDriver driver) Called beforeget(String url)
,navigate().to(String url)
.void
beforeScript
(String script, org.openqa.selenium.WebDriver driver) Called beforeJavascriptExecutor.executeScript(String, Object[])
void
beforeSwitchToWindow
(String s, org.openqa.selenium.WebDriver webDriver) Called beforeWebDriver.switchTo()
()}void
onException
(Throwable throwable, org.openqa.selenium.WebDriver driver) Called whenever an exception would be thrown.
-
Constructor Details
-
EventsSupport
Creates a new events support- Parameters:
eventsRegistry
- events registry
-
-
Method Details
-
beforeFindBy
public void beforeFindBy(org.openqa.selenium.By by, FluentWebElement element, org.openqa.selenium.WebDriver driver) Description copied from interface:EventListener
Called beforeWebDriver.findElement(...)
,WebDriver.findElements(...)
,WebElement.findElement(...)
,#findElement WebElement.findElements(...)
.- Specified by:
beforeFindBy
in interfaceEventListener
- Parameters:
by
- locator being usedelement
- will benull
, if a find method ofWebDriver
is called.driver
- WebDriver
-
afterFindBy
public void afterFindBy(org.openqa.selenium.By by, FluentWebElement element, org.openqa.selenium.WebDriver driver) Description copied from interface:EventListener
Called afterWebDriver.findElement(...)
,WebDriver.findElements(...)
,WebElement.findElement(...)
,WebElement.findElements(...)
.- Specified by:
afterFindBy
in interfaceEventListener
- Parameters:
by
- locator being usedelement
- will benull
, if a find method ofWebDriver
is called.driver
- WebDriver
-
beforeClickOn
Description copied from interface:EventListener
Called beforeWebElement.click()
.- Specified by:
beforeClickOn
in interfaceEventListener
- Parameters:
element
- the WebElement being used for the actiondriver
- WebDriver
-
afterClickOn
Description copied from interface:EventListener
Called afterWebElement.click()
. Not called, if an exception is thrown.- Specified by:
afterClickOn
in interfaceEventListener
- Parameters:
element
- the WebElement being used for the actiondriver
- WebDriver
-
beforeChangeValueOf
public void beforeChangeValueOf(FluentWebElement element, org.openqa.selenium.WebDriver driver, CharSequence[] charSequence) Description copied from interface:EventListener
Called beforeWebElement.clear()
,WebElement.sendKeys(java.lang.CharSequence...)
,WebElement.sendKeys(CharSequence...)
.- Specified by:
beforeChangeValueOf
in interfaceEventListener
- Parameters:
element
- the WebElement being used for the actiondriver
- WebDrivercharSequence
- value of the element
-
afterChangeValueOf
public void afterChangeValueOf(FluentWebElement element, org.openqa.selenium.WebDriver driver, CharSequence[] charSequence) Description copied from interface:EventListener
Called afterWebElement.clear()
,WebElement.sendKeys(java.lang.CharSequence...)
,WebElement.sendKeys(CharSequence...)
. Not called, if an exception is thrown.- Specified by:
afterChangeValueOf
in interfaceEventListener
- Parameters:
element
- the WebElement being used for the actiondriver
- WebDrivercharSequence
- value of the element
-
beforeGetText
Description copied from interface:EventListener
Called beforeWebElement.getText()
()}- Specified by:
beforeGetText
in interfaceEventListener
- Parameters:
webElement
- WebElementwebDriver
- WebDriver
-
afterGetText
public void afterGetText(FluentWebElement webElement, org.openqa.selenium.WebDriver webDriver, String s) Description copied from interface:EventListener
Called afterWebElement.getText()
()}- Specified by:
afterGetText
in interfaceEventListener
- Parameters:
webElement
- WebElementwebDriver
- WebDrivers
- String
-
beforeScript
Description copied from interface:EventListener
Called beforeJavascriptExecutor.executeScript(String, Object[])
- Specified by:
beforeScript
in interfaceEventListener
- Parameters:
script
- the script to be executeddriver
- WebDriver
-
afterScript
Description copied from interface:EventListener
Called afterJavascriptExecutor.executeScript(String, Object[])
. Not called if an exception is thrown- Specified by:
afterScript
in interfaceEventListener
- Parameters:
script
- the script that was executeddriver
- WebDriver
-
onException
Description copied from interface:EventListener
Called whenever an exception would be thrown.- Specified by:
onException
in interfaceEventListener
- Parameters:
throwable
- the exception that will be throwndriver
- WebDriver
-
beforeAlertAccept
public void beforeAlertAccept(org.openqa.selenium.WebDriver driver) Description copied from interface:EventListener
Called beforeAlert.accept()
- Specified by:
beforeAlertAccept
in interfaceEventListener
- Parameters:
driver
- WebDriver
-
afterAlertAccept
public void afterAlertAccept(org.openqa.selenium.WebDriver driver) Description copied from interface:EventListener
Called afterAlert.accept()
- Specified by:
afterAlertAccept
in interfaceEventListener
- Parameters:
driver
- WebDriver
-
beforeAlertDismiss
public void beforeAlertDismiss(org.openqa.selenium.WebDriver driver) Description copied from interface:EventListener
Called beforeAlert.dismiss()
- Specified by:
beforeAlertDismiss
in interfaceEventListener
- Parameters:
driver
- WebDriver
-
afterAlertDismiss
public void afterAlertDismiss(org.openqa.selenium.WebDriver driver) Description copied from interface:EventListener
Called afterAlert.dismiss()
- Specified by:
afterAlertDismiss
in interfaceEventListener
- Parameters:
driver
- WebDriver
-
beforeSwitchToWindow
Description copied from interface:EventListener
Called beforeWebDriver.switchTo()
()}- Specified by:
beforeSwitchToWindow
in interfaceEventListener
- Parameters:
s
- StringwebDriver
- WebDriver
-
afterSwitchToWindow
Description copied from interface:EventListener
Called afterWebDriver.switchTo()
()}- Specified by:
afterSwitchToWindow
in interfaceEventListener
- Parameters:
s
- StringwebDriver
- WebDriver
-
beforeGetScreenshotAs
public <X> void beforeGetScreenshotAs(org.openqa.selenium.OutputType<X> outputType) Description copied from interface:EventListener
Called beforeTakesScreenshot.getScreenshotAs(OutputType)
()}- Specified by:
beforeGetScreenshotAs
in interfaceEventListener
- Type Parameters:
X
- object- Parameters:
outputType
- OutputType
-
afterGetScreenshotAs
public <X> void afterGetScreenshotAs(org.openqa.selenium.OutputType<X> outputType, X x) Description copied from interface:EventListener
Called afterTakesScreenshot.getScreenshotAs(OutputType)
()}- Specified by:
afterGetScreenshotAs
in interfaceEventListener
- Type Parameters:
X
- object- Parameters:
outputType
- OutputTypex
- object