- Learn Selenium
- Unmesh Gundecha Carl Cocchiaro
- 150字
- 2021-06-24 13:25:47
Understanding WebDriver Events
Selenium WebDriver provides an API for tracking the various events that happen when test scripts are executed using WebDriver. Many navigation events get fired before and after a WebDriver internal event occurs (such as before and after navigating to a URL, and before and after browser back-navigation) and these can be tracked and captured. To throw an event, WebDriver gives you a class named EventFiringWebDriver, and to catch that event, it provides the test-script developer with an interface named WebDriverEventListener. The test-script developer should provide its own implementations for the overridden methods from the interface. In this chapter, we will look at the following topics:
- How to listen to and handle various browser-navigation events by using EventFiringWebDriver
- How to listen to and handle web-element action events that get triggered during the execution of test scripts
- Adding additional features to WebDriver to capture performance or accessibility testing