From the course: Advanced Selenium: Support Classes

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

What is EventFiringWebDriver?

What is EventFiringWebDriver? - Selenium Tutorial

From the course: Advanced Selenium: Support Classes

Start my 1-month free trial

What is EventFiringWebDriver?

- One common question associated with Selenium WebDriver is: how do we log the actions that our test performs? The support classes have a mechanism for this called the EventFiringWebDriver. First, we'll look at an approach without the support classes. In this test code here, starting at line 30, you can see I've used a bunch of print statements to log the actions that the test does. Let's just get familiar with the code, and I'll do that by running in debug mode, so, we can see it in action. Run this in debug mode. First thing we do is create some locators for two elements. The resend button and one called noSuchElemenet, which does not exist. The next chunk outputs the string Looking For, and the locator that we're looking for, it puts it in the console, then we find the element and assert that we found it, then print that we're finished looking for the element. Then move on to the noSuchElement, print that…

Contents