Extending AbstractWebDriverEventListener

The second way to create a listener class is by extending the AbstractWebDriverEventListene r class. AbstractWebDriverEventListener is an abstract class that implements WebDriverEventListener. Though it doesn't really provide any implementation for the methods in the WebDriverEventListener interface, it creates a dummy implementation such that the listener class that you are creating doesn't have to contain all the methods, only the ones that you, as a test-script developer, are interested in. The following is a class we have created that extends AbstractWebDriverEventListener and provides implementations for a couple of methods in it. This way, we can override only the methods that we are interested ...

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.