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 ...

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.