Listening for the clicked WebElement

This event occurs when a WebElement is clicked, that is, by executing webElement.click(). There are two methods to listen for this event in the WebDriverEventListener implementation:

public void beforeClickOn(WebElement element, WebDriver driver)

The preceding method is invoked when the WebDriver is about to click on a particular WebElement. The WebElement that is going to be clicked on and the WebDriver that is clicking on it are sent as parameters to this method so that the test-script developer can interpret which driver performed the click action, and on which element the action was performed:

public void afterClickOn(WebElement element, WebDriver driver)

The EventFiringWebDriver class notifies the preceding method after the click action is taken on a WebElement. Similar to the beforeClickOn() method, this method is also sent the WebElement and WebDriver instances. If an exception occurs during a click event, this method is not called.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.203.172