Selenium provides an API for various events that occur when our scripts are executed like click, switch to a window, navigation, onException, etc. and these can be registered using WebDriverEventListener interface or EventFiringWebDriver class. These events play a pivotal role in analyzing results and in debugging issues (if any). EventFiringWebDriver class takes care of all events that are occurred while the execution of your script. EventFiringWebDriver class can be bind to more than one listener but all event listeners should be registered with the EventFiringWebDriver class so that it can be notified. EventFiringWebDriver eventFiring =new EventFiringWebDriver(driver); FirstEventCapture firstListener =new FirstEventCapture(); //FirstEventCapture implements WebDriverEventListener SecondEventCapture secondListener =new SecondEventCapture(); //SecondEventCapture implements WebDriverEventListener eventFiring.register(firstListener); eventFiring.register(secondListener); Check t...
A blog about my testing stories where I pen down my thoughts about test automation covering primarily Selenium, Java, Rest Assured, Karate, Maven, TestNG, Postman, newman, Jenkins, Git, Azure DevOps, etc.