Hi Ashsish Sir,
I need help sir.The application I am working on is kind of e-commerce application. My issue is - the website displays an popup (This popup is Feedback/Customer experiece). The issue is this popup is random in nature,this popup is displayed randomly at any page or for any step.
Can you please help how to handle this popup. In one of the website i saw the following solution . But I am not able to implement this.
Solution: Webdriver provides WebDriverEventListener interface so that you can register your listener with WebDriver and execute custom code based on the events fired by WebDriver.
public class PopUpListener implements WebDriverEventListener {
//Override all the methods present in WebDriverEventListener interface
public void afterClickOn(WebElement element,
WebDriver driver){
//code here to dismiss popup
}
}
Register the listener with webDriver
WebDriverEventListener popupListener = new PopUpListener ();
WebDriver driver = new EventFiringWebDriver(new FirefoxDriver())
.register(popupListener);