Interface WebDriverListener


@Beta public interface WebDriverListener
Classes that implement this interface are intended to be used with EventFiringDecorator, read documentation for this class to find detailed usage description.

This interface provides empty default implementation for all methods that do nothing.

  • Method Details

    • beforeAnyCall

      default void beforeAnyCall(Object target, Method method, Object[] args)
      This method is called before the execution of any method on the 'target' object. It provides a hook for performing actions or logging before any method call.
      Parameters:
      target - The original object on which methods will be invoked.
      method - The method that will be called on the 'target' object.
      args - The arguments that will be passed to the method.
    • afterAnyCall

      default void afterAnyCall(Object target, Method method, Object[] args, Object result)
      This method is called after the execution of any instance methods on the 'target' object. It provides a hook for performing actions or logging after any instance method call.
      Parameters:
      target - The original object on which instance methods were invoked.
      method - The method that was called on the 'target' object.
      args - The arguments passed to the method.
      result - The result returned by the method.
    • onError

      default void onError(Object target, Method method, Object[] args, InvocationTargetException e)
      Notifies registered listeners about an error that occurred during the execution of a decorated method.
      Parameters:
      target - The original object on which the decorated method was invoked.
      method - The method that encountered an error.
      args - The arguments passed to the method.
      e - The InvocationTargetException containing the error details.
    • beforeAnyWebDriverCall

      default void beforeAnyWebDriverCall(WebDriver driver, Method method, Object[] args)
      This method will be called before any method of a WebDriver instance is called.
      Parameters:
      driver - - decorated WebDriver instance
      method - - method that will be called
      args - - arguments for the method
    • afterAnyWebDriverCall

      default void afterAnyWebDriverCall(WebDriver driver, Method method, Object[] args, Object result)
      This method will be called after any method of a WebDriver instance is called.
      Parameters:
      driver - - decorated WebDriver instance
      method - - method that was called
      args - - arguments for the method
      result - - result of the method call
    • beforeGet

      default void beforeGet(WebDriver driver, String url)
      This method will be called before WebDriver.get(String) is called.
      Parameters:
      driver - - decorated WebDriver instance
      url - - url to navigate to
    • afterGet

      default void afterGet(WebDriver driver, String url)
      This method will be called after WebDriver.get(String) is called.
      Parameters:
      driver - - decorated WebDriver instance
      url - - url navigated to
    • beforeGetCurrentUrl

      default void beforeGetCurrentUrl(WebDriver driver)
      This method will be called before WebDriver.getCurrentUrl() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterGetCurrentUrl

      default void afterGetCurrentUrl(WebDriver driver, String result)
      This method will be called after WebDriver.getCurrentUrl() is called.
      Parameters:
      driver - - decorated WebDriver instance
      result - - url of the current page
    • beforeGetTitle

      default void beforeGetTitle(WebDriver driver)
      This method will be called before WebDriver.getTitle() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterGetTitle

      default void afterGetTitle(WebDriver driver, String result)
      This method will be called after WebDriver.getTitle() is called.
      Parameters:
      driver - - decorated WebDriver instance
      result - - title of the current page
    • beforeFindElement

      default void beforeFindElement(WebDriver driver, By locator)
      This method will be called before WebDriver.findElement(By) is called.
      Parameters:
      driver - - decorated WebDriver instance
      locator - - locator used to find the element
    • afterFindElement

      default void afterFindElement(WebDriver driver, By locator, WebElement result)
      This method will be called after WebDriver.findElement(By) is called.
      Parameters:
      driver - - decorated WebDriver instance
      locator - - locator used to find the element
      result - - found WebElement
    • beforeFindElements

      default void beforeFindElements(WebDriver driver, By locator)
      This method will be called before WebDriver.findElements(By) is called.
      Parameters:
      driver - - decorated WebDriver instance
      locator - - locator used to find the elements
    • afterFindElements

      default void afterFindElements(WebDriver driver, By locator, List<WebElement> result)
      This method will be called after WebDriver.findElements(By) is called.
      Parameters:
      driver - - decorated WebDriver instance
      locator - - locator used to find the elements
      result - - list of found WebElements
    • beforeGetPageSource

      default void beforeGetPageSource(WebDriver driver)
      This method will be called before WebDriver.getPageSource() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterGetPageSource

      default void afterGetPageSource(WebDriver driver, String result)
      This method will be called after WebDriver.getPageSource() is called.
      Parameters:
      driver - - decorated WebDriver instance
      result - - page source of the current page
    • beforeClose

      default void beforeClose(WebDriver driver)
      This method will be called before WebDriver.close() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterClose

      default void afterClose(WebDriver driver)
      This method will be called after WebDriver.close() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • beforeQuit

      default void beforeQuit(WebDriver driver)
      This method will be called before WebDriver.quit() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterQuit

      default void afterQuit(WebDriver driver)
      This method will be called after WebDriver.quit() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • beforeGetWindowHandles

      default void beforeGetWindowHandles(WebDriver driver)
      This method will be called before WebDriver.getWindowHandles() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterGetWindowHandles

      default void afterGetWindowHandles(WebDriver driver, Set<String> result)
      This method will be called after WebDriver.getWindowHandles() is called.
      Parameters:
      driver - - decorated WebDriver instance
      result - - set of window handles
    • beforeGetWindowHandle

      default void beforeGetWindowHandle(WebDriver driver)
      This method will be called before WebDriver.getWindowHandle() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterGetWindowHandle

      default void afterGetWindowHandle(WebDriver driver, String result)
      This method will be called after WebDriver.getWindowHandle() is called.
      Parameters:
      driver - - decorated WebDriver instance
      result - - window handle of the current window
    • beforeExecuteScript

      default void beforeExecuteScript(WebDriver driver, String script, Object[] args)
      This method will be called before JavascriptExecutor.executeScript(ScriptKey, Object...) is called.
      Parameters:
      driver - - decorated WebDriver instance
      script - - script to be executed
      args - - arguments to the script
    • afterExecuteScript

      default void afterExecuteScript(WebDriver driver, String script, Object[] args, Object result)
      This method will be called after JavascriptExecutor.executeScript(ScriptKey, Object...) is called.
      Parameters:
      driver - - decorated WebDriver instance
      script - - script to be executed
      args - - arguments to the script
      result - - result of the script execution
    • beforeExecuteAsyncScript

      default void beforeExecuteAsyncScript(WebDriver driver, String script, Object[] args)
      This method will be called before JavascriptExecutor.executeAsyncScript(String, Object...)is called.
      Parameters:
      driver - - decorated WebDriver instance
      script - - script to be executed
      args - - arguments to the script
    • afterExecuteAsyncScript

      default void afterExecuteAsyncScript(WebDriver driver, String script, Object[] args, Object result)
      This method will be called after JavascriptExecutor.executeAsyncScript(String, Object...) is called.
      Parameters:
      driver - - decorated WebDriver instance
      script - - script to be executed
      args - - arguments to the script
      result - - result of the script execution
    • beforePerform

      default void beforePerform(WebDriver driver, Collection<Sequence> actions)
      This method will be called before Actions.perform() } is called.
      Parameters:
      driver - - decorated WebDriver instance
      actions - - sequence of actions to be performed
    • afterPerform

      default void afterPerform(WebDriver driver, Collection<Sequence> actions)
      This method will be called after Actions.perform() } is called.
      Parameters:
      driver - - decorated WebDriver instance
      actions - - sequence of actions to be performed
    • beforeResetInputState

      default void beforeResetInputState(WebDriver driver)
      This method will be called before RemoteWebDriver.resetInputState() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • afterResetInputState

      default void afterResetInputState(WebDriver driver)
      This method will be called after RemoteWebDriver.resetInputState() is called.
      Parameters:
      driver - - decorated WebDriver instance
    • beforeAnyWebElementCall

      default void beforeAnyWebElementCall(WebElement element, Method method, Object[] args)
      This method will be called before any method of a WebElement instance is called.
      Parameters:
      element - - decorated WebElement instance
      method - - method that will be called
      args - - arguments for the method
    • afterAnyWebElementCall

      default void afterAnyWebElementCall(WebElement element, Method method, Object[] args, Object result)
      This method will be called after any method of a WebElement instance is called.
      Parameters:
      element - - decorated WebElement instance
      method - - method that was called
      args - - arguments for the method
      result - - result of the method call
    • beforeClick

      default void beforeClick(WebElement element)
      This action will be performed each time before WebElement.click() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterClick

      default void afterClick(WebElement element)
      This action will be performed each time after WebElement.click() is called.
      Parameters:
      element - - decorated WebElement instance
    • beforeSubmit

      default void beforeSubmit(WebElement element)
      This action will be performed each time before WebElement.submit() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterSubmit

      default void afterSubmit(WebElement element)
      This action will be performed each time after WebElement.submit() is called.
      Parameters:
      element - - decorated WebElement instance
    • beforeSendKeys

      default void beforeSendKeys(WebElement element, CharSequence... keysToSend)
      This action will be performed each time before WebElement.sendKeys(CharSequence...) is called.
      Parameters:
      element - - decorated WebElement instance
      keysToSend - - keys to send
    • afterSendKeys

      default void afterSendKeys(WebElement element, CharSequence... keysToSend)
    • beforeClear

      default void beforeClear(WebElement element)
      This action will be performed each time before WebElement.clear() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterClear

      default void afterClear(WebElement element)
      This action will be performed each time after WebElement.clear() is called.
      Parameters:
      element - - decorated WebElement instance
    • beforeGetTagName

      default void beforeGetTagName(WebElement element)
      This action will be performed each time before WebElement.getTagName() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterGetTagName

      default void afterGetTagName(WebElement element, String result)
      This action will be performed each time after WebElement.getTagName() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (tag name of the element)
    • beforeGetAttribute

      default void beforeGetAttribute(WebElement element, String name)
      This action will be performed each time before WebElement.getAttribute(String) is called.
      Parameters:
      element - - decorated WebElement instance
      name - - name of the attribute
    • afterGetAttribute

      default void afterGetAttribute(WebElement element, String name, String result)
      This action will be performed each time after WebElement.getAttribute(String) is called.
      Parameters:
      element - - decorated WebElement instance
      name - - name of the attribute
      result - - result of the method call (value of the attribute)
    • beforeIsSelected

      default void beforeIsSelected(WebElement element)
      This action will be performed each time before WebElement.isSelected() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterIsSelected

      default void afterIsSelected(WebElement element, boolean result)
      This action will be performed each time after WebElement.isSelected() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (true if the element is selected)
    • beforeIsEnabled

      default void beforeIsEnabled(WebElement element)
      This action will be performed each time before WebElement.isEnabled() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterIsEnabled

      default void afterIsEnabled(WebElement element, boolean result)
      This action will be performed each time after WebElement.isEnabled() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (true if the element is enabled)
    • beforeGetText

      default void beforeGetText(WebElement element)
      This action will be performed each time before WebElement.getText() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterGetText

      default void afterGetText(WebElement element, String result)
      This action will be performed each time after WebElement.getText() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (text of the element)
    • beforeFindElement

      default void beforeFindElement(WebElement element, By locator)
      This action will be performed each time before WebElement.findElement(By) is called.
      Parameters:
      element - - decorated WebElement instance
      locator - - locator used to find the elements
    • afterFindElement

      default void afterFindElement(WebElement element, By locator, WebElement result)
      This action will be performed each time after WebElement.findElement(By) is called.
      Parameters:
      element - - decorated WebElement instance
      locator - - locator used to find the elements
      result - - found WebElement (can be null)
    • beforeFindElements

      default void beforeFindElements(WebElement element, By locator)
      This action will be performed each time before WebElement.findElements(By) is called.
      Parameters:
      element - - decorated WebElement instance
      locator - - locator used to find the elements
    • afterFindElements

      default void afterFindElements(WebElement element, By locator, List<WebElement> result)
      This action will be performed each time after WebElement.findElements(By) is called.
      Parameters:
      element - - decorated WebElement instance
      locator - - locator used to find the elements
      result - - list of found WebElements (can be empty)
    • beforeIsDisplayed

      default void beforeIsDisplayed(WebElement element)
      This action will be performed each time before WebElement.isDisplayed() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterIsDisplayed

      default void afterIsDisplayed(WebElement element, boolean result)
      This action will be performed each time after WebElement.isDisplayed() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (true if the element is displayed)
    • beforeGetLocation

      default void beforeGetLocation(WebElement element)
      This action will be performed each time before WebElement.getLocation() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterGetLocation

      default void afterGetLocation(WebElement element, Point result)
      This action will be performed each time after WebElement.getLocation() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (coordinates of the top-left corner of the element)
    • beforeGetSize

      default void beforeGetSize(WebElement element)
      This action will be performed each time before WebElement.getSize() is called.
      Parameters:
      element - - decorated WebElement instance
    • afterGetSize

      default void afterGetSize(WebElement element, Dimension result)
      This action will be performed each time after WebElement.getSize() is called.
      Parameters:
      element - - decorated WebElement instance
      result - - result of the method call (size of the element)
    • beforeGetCssValue

      default void beforeGetCssValue(WebElement element, String propertyName)
      This action will be performed each time before WebElement.getCssValue(String) is called.
      Parameters:
      element - - decorated WebElement instance
      propertyName - - name of the css property
    • afterGetCssValue

      default void afterGetCssValue(WebElement element, String propertyName, String result)
      This action will be performed each time after WebElement.getCssValue(String) is called.
      Parameters:
      element - - decorated WebElement instance
      propertyName - - name of the css property
      result - - result of the method call (value of the css property)
    • beforeAnyNavigationCall

      default void beforeAnyNavigationCall(WebDriver.Navigation navigation, Method method, Object[] args)
      This method will be called before any method of a WebDriver.Navigation instance is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
      method - - method that will be called
      args - - arguments for the method
    • afterAnyNavigationCall

      default void afterAnyNavigationCall(WebDriver.Navigation navigation, Method method, Object[] args, Object result)
      This method will be called after any method of a WebDriver.Navigation instance is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
      method - - method that was called
      args - - arguments for the method
      result - - result of the method call
    • beforeTo

      default void beforeTo(WebDriver.Navigation navigation, String url)
      This action will be performed each time before WebDriver.Navigation.to(String) is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
      url - - url to navigate to (can be relative)
    • afterTo

      default void afterTo(WebDriver.Navigation navigation, String url)
      This action will be performed each time after WebDriver.Navigation.to(String) is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
      url - - url to navigate to (can be relative)
    • beforeTo

      default void beforeTo(WebDriver.Navigation navigation, URL url)
      This action will be performed each time before WebDriver.Navigation.to(URL) is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
      url - - url to navigate to (can be relative)
    • afterTo

      default void afterTo(WebDriver.Navigation navigation, URL url)
      This action will be performed each time after WebDriver.Navigation.to(URL) is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
      url - - url to navigate to (can be relative)
    • beforeBack

      default void beforeBack(WebDriver.Navigation navigation)
      This action will be performed each time before WebDriver.Navigation.back() is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
    • afterBack

      default void afterBack(WebDriver.Navigation navigation)
      This action will be performed each time after WebDriver.Navigation.back() is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
    • beforeForward

      default void beforeForward(WebDriver.Navigation navigation)
      This action will be performed each time before WebDriver.Navigation.forward() is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
    • afterForward

      default void afterForward(WebDriver.Navigation navigation)
      This action will be performed each time after WebDriver.Navigation.forward() is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
    • beforeRefresh

      default void beforeRefresh(WebDriver.Navigation navigation)
      This action will be performed each time before WebDriver.Navigation.refresh() is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
    • afterRefresh

      default void afterRefresh(WebDriver.Navigation navigation)
      This action will be performed each time after WebDriver.Navigation.refresh() is called.
      Parameters:
      navigation - - decorated WebDriver.Navigation instance
    • beforeAnyAlertCall

      default void beforeAnyAlertCall(Alert alert, Method method, Object[] args)
      Parameters:
      alert - - The alert that will be called
      method - - The method that will be called
      args - - The arguments that will be passed to the method
    • afterAnyAlertCall

      default void afterAnyAlertCall(Alert alert, Method method, Object[] args, Object result)
    • beforeAccept

      default void beforeAccept(Alert alert)
      This action will be performed each time before Alert.accept()
      Parameters:
      alert - - alert to accept
    • afterAccept

      default void afterAccept(Alert alert)
      This action will be performed each time after Alert.accept()
      Parameters:
      alert - - alert to accept
    • beforeDismiss

      default void beforeDismiss(Alert alert)
      This action will be performed each time before Alert.dismiss()
      Parameters:
      alert - - alert to dismiss
    • afterDismiss

      default void afterDismiss(Alert alert)
      This action will be performed each time after Alert.dismiss()
      Parameters:
      alert - - alert to dismiss
    • beforeGetText

      default void beforeGetText(Alert alert)
      This action will be performed each time before Alert.getText()
      Parameters:
      alert - - alert to get text from
    • afterGetText

      default void afterGetText(Alert alert, String result)
      This action will be performed each time after Alert.getText()
      Parameters:
      alert - - alert to get text from
    • beforeSendKeys

      default void beforeSendKeys(Alert alert, String text)
      This action will be performed each time before Alert.sendKeys(String)
      Parameters:
      alert - - alert to send keys to
      text - - keys to send
    • afterSendKeys

      default void afterSendKeys(Alert alert, String text)
      This action will be performed each time after Alert.sendKeys(String)
      Parameters:
      alert - - alert to send keys to
      text - - keys to send
    • beforeAnyOptionsCall

      default void beforeAnyOptionsCall(WebDriver.Options options, Method method, Object[] args)
      Parameters:
      options - The options object that will be called
      method - The method that will be called
      args - The arguments that will be passed to the method
    • afterAnyOptionsCall

      default void afterAnyOptionsCall(WebDriver.Options options, Method method, Object[] args, Object result)
      Parameters:
      options - The options object that will be called
      method - The method that will be called
      args - The arguments that will be passed to the method
      result - The result of the method call
    • beforeAddCookie

      default void beforeAddCookie(WebDriver.Options options, Cookie cookie)
      This action will be performed each time before WebDriver.Options.addCookie(Cookie)
      Parameters:
      options - - options to add cookie to
      cookie - - cookie to add
    • afterAddCookie

      default void afterAddCookie(WebDriver.Options options, Cookie cookie)
      This action will be performed each time after WebDriver.Options.addCookie(Cookie)
      Parameters:
      options - - options to add cookie to
      cookie - - cookie to add
    • beforeDeleteCookieNamed

      default void beforeDeleteCookieNamed(WebDriver.Options options, String name)
      This action will be performed each time before WebDriver.Options.deleteCookieNamed(String)
      Parameters:
      options - - options to delete cookie from
      name - - name of the cookie to delete
    • afterDeleteCookieNamed

      default void afterDeleteCookieNamed(WebDriver.Options options, String name)
      This action will be performed each time after WebDriver.Options.deleteCookieNamed(String)
      Parameters:
      options - - options to delete cookie from
      name - - name of the cookie to delete
    • beforeDeleteCookie

      default void beforeDeleteCookie(WebDriver.Options options, Cookie cookie)
      This action will be performed each time before WebDriver.Options.deleteCookie(Cookie)
      Parameters:
      options - - options to delete cookie from
      cookie - - cookie to delete
    • afterDeleteCookie

      default void afterDeleteCookie(WebDriver.Options options, Cookie cookie)
      This action will be performed each time after WebDriver.Options.deleteCookie(Cookie)
      Parameters:
      options - - options to delete cookie from
      cookie - - cookie to delete
    • beforeDeleteAllCookies

      default void beforeDeleteAllCookies(WebDriver.Options options)
      This action will be performed each time before WebDriver.Options.deleteAllCookies()
      Parameters:
      options - - options to delete cookies from
    • afterDeleteAllCookies

      default void afterDeleteAllCookies(WebDriver.Options options)
      This action will be performed each time after WebDriver.Options.deleteAllCookies()
      Parameters:
      options - - options to delete cookies from
    • beforeGetCookies

      default void beforeGetCookies(WebDriver.Options options)
      This action will be performed each time before WebDriver.Options.getCookies()
      Parameters:
      options - - options to get cookies from
    • afterGetCookies

      default void afterGetCookies(WebDriver.Options options, Set<Cookie> result)
      This action will be performed each time after WebDriver.Options.getCookies()
      Parameters:
      options - - options to get cookies from
      result - - set of cookies
    • beforeGetCookieNamed

      default void beforeGetCookieNamed(WebDriver.Options options, String name)
      This action will be performed each time before WebDriver.Options.getCookieNamed(String)
      Parameters:
      options - - options to get cookie from
      name - - name of the cookie to get
    • afterGetCookieNamed

      default void afterGetCookieNamed(WebDriver.Options options, String name, Cookie result)
      This action will be performed each time after WebDriver.Options.getCookieNamed(String)
      Parameters:
      options - - options to get cookie from
      name - - name of the cookie to get
      result - - cookie with the given name
    • beforeAnyTimeoutsCall

      default void beforeAnyTimeoutsCall(WebDriver.Timeouts timeouts, Method method, Object[] args)
      This method will be called before any method of a WebDriver.Timeouts instance is
      Parameters:
      timeouts - The timeouts object that will be called
      method - The method that will be called
      args - The arguments that will be passed to the method
    • afterAnyTimeoutsCall

      default void afterAnyTimeoutsCall(WebDriver.Timeouts timeouts, Method method, Object[] args, Object result)
      This method will be called after any method of a WebDriver.Timeouts instance is
      Parameters:
      timeouts - The timeouts object that will be called
      method - The method that will be called
      args - The arguments that will be passed to the method
      result - The result of the method call
    • beforeImplicitlyWait

      default void beforeImplicitlyWait(WebDriver.Timeouts timeouts, Duration duration)
      This action will be performed each time before WebDriver.Timeouts.implicitlyWait(Duration) is called.
      Parameters:
      timeouts - The timeouts object that will be called
      duration - The duration that will be passed to the method
    • afterImplicitlyWait

      default void afterImplicitlyWait(WebDriver.Timeouts timeouts, Duration duration)
      This action will be performed each time after WebDriver.Timeouts.implicitlyWait(Duration) is called.
      Parameters:
      timeouts - The timeouts object that will be called
      duration - The duration that will be passed to the method
    • beforeSetScriptTimeout

      default void beforeSetScriptTimeout(WebDriver.Timeouts timeouts, Duration duration)
      This action will be performed each time before WebDriver.Timeouts.setScriptTimeout(Duration) is called.
      Parameters:
      timeouts - The timeouts object that will be called
      duration - The duration that will be passed to the method
    • afterSetScriptTimeout

      default void afterSetScriptTimeout(WebDriver.Timeouts timeouts, Duration duration)
      This action will be performed each time after WebDriver.Timeouts.setScriptTimeout(Duration) is called.
      Parameters:
      timeouts - The timeouts object that will be called
      duration - The duration that will be passed to the method
    • beforePageLoadTimeout

      default void beforePageLoadTimeout(WebDriver.Timeouts timeouts, Duration duration)
      This action will be performed each time before WebDriver.Timeouts.pageLoadTimeout(Duration) is called.
      Parameters:
      timeouts - The timeouts object that will be called
      duration - The duration that will be passed to the method
    • afterPageLoadTimeout

      default void afterPageLoadTimeout(WebDriver.Timeouts timeouts, Duration duration)
      This action will be performed each time after WebDriver.Timeouts.pageLoadTimeout(Duration) is called.
      Parameters:
      timeouts - The timeouts object that will be called
      duration - The duration that will be passed to the method
    • beforeAnyWindowCall

      default void beforeAnyWindowCall(WebDriver.Window window, Method method, Object[] args)
      This method will be called before any method of a WebDriver.Window instance is
      Parameters:
      window - The window object that will be called
      method - The method that will be called
      args - The arguments that will be passed to the method
    • afterAnyWindowCall

      default void afterAnyWindowCall(WebDriver.Window window, Method method, Object[] args, Object result)
      This method will be called after any method of a WebDriver.Window instance is
      Parameters:
      window - The window object that will be called
      method - The method that will be called
      args - The arguments that will be passed to the method
      result - The result of the method call
    • beforeGetSize

      default void beforeGetSize(WebDriver.Window window)
      This action will be performed each time before WebDriver.Window.getSize() is called.
      Parameters:
      window - The window object that will be called
    • afterGetSize

      default void afterGetSize(WebDriver.Window window, Dimension result)
      This action will be performed each time after WebDriver.Window.getSize() is called.
      Parameters:
      window - The window object that will be called
      result - The result of the method call
    • beforeSetSize

      default void beforeSetSize(WebDriver.Window window, Dimension size)
      This action will be performed each time before WebDriver.Window.setSize(Dimension) is called.
      Parameters:
      window - The window object that will be called
      size - The size that will be passed to the method
    • afterSetSize

      default void afterSetSize(WebDriver.Window window, Dimension size)
      This action will be performed each time after WebDriver.Window.setSize(Dimension) is called.
      Parameters:
      window - The window object that will be called
      size - The size that will be passed to the method
    • beforeGetPosition

      default void beforeGetPosition(WebDriver.Window window)
      This action will be performed each time before WebDriver.Window.getPosition() is called.
      Parameters:
      window - The window object that will be called
    • afterGetPosition

      default void afterGetPosition(WebDriver.Window window, Point result)
      This action will be performed each time after WebDriver.Window.getPosition() is called.
      Parameters:
      window - The window object that will be called
      result - The result of the method call
    • beforeSetPosition

      default void beforeSetPosition(WebDriver.Window window, Point position)
      This action will be performed each time before WebDriver.Window.setPosition(Point) is called.
      Parameters:
      window - The window object that will be called
      position - The position that will be passed to the method
    • afterSetPosition

      default void afterSetPosition(WebDriver.Window window, Point position)
      This action will be performed each time after WebDriver.Window.setPosition(Point) is called.
      Parameters:
      window - The window object that will be called
      position - The position that will be passed to the method
    • beforeMaximize

      default void beforeMaximize(WebDriver.Window window)
      This action will be performed each time before WebDriver.Window.maximize() is called.
      Parameters:
      window - The window object that will be called
    • afterMaximize

      default void afterMaximize(WebDriver.Window window)
      This action will be performed each time after WebDriver.Window.maximize() is called.
      Parameters:
      window - The window object that will be called
    • beforeFullscreen

      default void beforeFullscreen(WebDriver.Window window)
      This action will be performed each time before WebDriver.Window.fullscreen() is called.
      Parameters:
      window - The window object that will be called
    • afterFullscreen

      default void afterFullscreen(WebDriver.Window window)
      This action will be performed each time after WebDriver.Window.fullscreen() is called.
      Parameters:
      window - The window object that will be called
    • beforeAnyTargetLocatorCall

      default void beforeAnyTargetLocatorCall(WebDriver.TargetLocator targetLocator, Method method, Object[] args)
      Called before any method in WebDriver.TargetLocator class.
      Parameters:
      targetLocator - the target locator being used for the action
      method - the method being invoked
      args - the arguments to the method
    • afterAnyTargetLocatorCall

      default void afterAnyTargetLocatorCall(WebDriver.TargetLocator targetLocator, Method method, Object[] args, Object result)
      Called after any method in WebDriver.TargetLocator class.
      Parameters:
      targetLocator - the target locator being used for the action
      method - the method being invoked
      args - the arguments to the method
      result - the result of the method call
    • beforeFrame

      default void beforeFrame(WebDriver.TargetLocator targetLocator, int index)
      This action will be performed each time before WebDriver.TargetLocator.frame(int) ()} is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      index - The zero-based index.
    • afterFrame

      default void afterFrame(WebDriver.TargetLocator targetLocator, int index, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.frame(int) ()} is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      index - The zero-based index.
    • beforeFrame

      default void beforeFrame(WebDriver.TargetLocator targetLocator, String nameOrId)
      This action will be performed each time before WebDriver.TargetLocator.frame(String) ()} is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      nameOrId - The name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index.
    • afterFrame

      default void afterFrame(WebDriver.TargetLocator targetLocator, String nameOrId, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.frame(String) ()} is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      nameOrId - The name of the frame window, the id of the <frame> or <iframe> element, or the (zero-based) index.
      driver - The current driver instance.
    • beforeFrame

      default void beforeFrame(WebDriver.TargetLocator targetLocator, WebElement frameElement)
      This action will be performed each time before WebDriver.TargetLocator.frame(WebElement) ()} is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      frameElement - The frame element to switch to.
    • afterFrame

      default void afterFrame(WebDriver.TargetLocator targetLocator, WebElement frameElement, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.frame(WebElement) ()} is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      frameElement - The frame element to switch to.
      driver - The current driver instance.
    • beforeParentFrame

      default void beforeParentFrame(WebDriver.TargetLocator targetLocator)
      This action will be performed each time before WebDriver.TargetLocator.parentFrame() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
    • afterParentFrame

      default void afterParentFrame(WebDriver.TargetLocator targetLocator, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.parentFrame() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      driver - The current driver instance.
    • beforeWindow

      default void beforeWindow(WebDriver.TargetLocator targetLocator, String nameOrHandle)
      This action will be performed each time before WebDriver.TargetLocator.window(String).
      Parameters:
      targetLocator - the target locator being used for the action
      nameOrHandle - The name of the window or the handle as returned by WebDriver.getWindowHandle() or null if switching to a new window created by WebDriver.TargetLocator.newWindow(WindowType)
    • afterWindow

      default void afterWindow(WebDriver.TargetLocator targetLocator, String nameOrHandle, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.window(String).
      Parameters:
      targetLocator - The target locator being used for the action.
      nameOrHandle - The name of the window or the handle as returned by WebDriver.getWindowHandle() or null if switching to a new window created by WebDriver.TargetLocator.newWindow(WindowType).
      driver - The current driver instance.
    • beforeNewWindow

      default void beforeNewWindow(WebDriver.TargetLocator targetLocator, WindowType typeHint)
      This action will be performed each time before WebDriver.TargetLocator.newWindow(WindowType) is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      typeHint - The type of new browser window to be created. The created window is not guaranteed to be of the requested type; if the driver does not support the requested type, a new browser window will be created of whatever type the driver does support.
    • afterNewWindow

      default void afterNewWindow(WebDriver.TargetLocator targetLocator, WindowType typeHint, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.newWindow(WindowType) is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      typeHint - The type of new browser window to be created. The created window is not guaranteed to be of the requested type; if the driver does not support the requested type, a new browser window will be created of whatever type the driver does support.
      driver - The current driver instance.
    • beforeDefaultContent

      default void beforeDefaultContent(WebDriver.TargetLocator targetLocator)
      This action will be performed each time before WebDriver.TargetLocator.defaultContent() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
    • afterDefaultContent

      default void afterDefaultContent(WebDriver.TargetLocator targetLocator, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.defaultContent() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      driver - The current driver instance.
    • beforeActiveElement

      default void beforeActiveElement(WebDriver.TargetLocator targetLocator)
      This action will be performed each time before WebDriver.TargetLocator.activeElement() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
    • afterActiveElement

      default void afterActiveElement(WebDriver.TargetLocator targetLocator, WebDriver driver)
      This action will be performed each time after WebDriver.TargetLocator.activeElement() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      driver - The current driver instance.
    • beforeAlert

      default void beforeAlert(WebDriver.TargetLocator targetLocator)
      This action will be performed each time before WebDriver.TargetLocator.alert() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
    • afterAlert

      default void afterAlert(WebDriver.TargetLocator targetLocator, Alert alert)
      This action will be performed each time after WebDriver.TargetLocator.alert() is called.
      Parameters:
      targetLocator - The target locator being used for the action.
      alert - The found alert.