1. What are the listeners of selenium?
- It is an interface
WebDriverListener is one of the interfaces which contain a method of selenium events.
- We can use listeners to track events of the script during the execution
- Can use them to log special information as below
- Log info about script start and end
- Log info about script execution duration
- Log info about script pass-fail details
2. Provide a few abstract methods in WebDriverListner interface
- beforeQuit
(WebDriver driver) - This method will be called before WebDriver.quit()
is called. - beforeSubmit
(WebElement element) - This action will be performed each time before WebElement.submit()
is called. - onError
(Object target, Method method, Object[] args, InvocationTargetException e) - Notifies registered listeners about an error that occurred during the execution of a decorated method. - afterClose
(WebDriver driver) - This method will be called after WebDriver.close()
is called.
No comments:
Post a Comment