Exploring different WebDriver event listeners

We have seen some of the methods in our EventListeners that get invoked when their corresponding events are executed, for example, before and after navigation methods are invoked when the navigateTo event is triggered. Here we'll see all of the methods that WebDriverEventListener provides us.

Listening for WebElement value change

This event occurs when the value of a WebElement changes when the sendKeys() or clear() methods are executed on them. There are two methods associated with this event.

public void beforeChangeValueOf(WebElement element, WebDriver driver)

The preceding method is invoked before the WebDriver attempts to change the value of the WebElement. As a parameter, the WebElement itself is ...

Get Selenium WebDriver Practical Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.