Listeners

 1. What are the listeners of selenium?

  1. It is an interface
  2. WebDriverListener is one of the interfaces which contain a method of selenium events.

  3. We can use listeners to track events of the script during the execution
  4. Can use them to log special information as below
  5. Log info about script start and end
  6. Log info about script execution duration
  7. Log info about script pass-fail details

 2. Provide a few abstract methods in WebDriverListner interface

  1. beforeQuit(WebDriver driver) - This method will be called before WebDriver.quit() is called.
  2. beforeSubmit(WebElement element) - This action will be performed each time before WebElement.submit() is called.
  3. onError(Object target, Method method, Object[] args, InvocationTargetException e) - Notifies registered listeners about an error that occurred during the execution of a decorated method.
  4. afterClose(WebDriver driver) - This method will be called after WebDriver.close() is called.

No comments:

Post a Comment

Cucumber

What is Cucumber? Definition : Cucumber is an open-source tool that supports BDD . Purpose : Bridges the communication gap between business ...