Skip to content Skip to sidebar Skip to footer

When Running Selenium Webdriver Test No Alert Appears

I'm running a Selenium webdriver test in FireFox. After clicking on a button a Javascript (JQuery/Bootstrap) alert has to appear but no matter how I run the program (eclipse, debug

Solution 1:

Actually in Selenium webdriver for Firefox by default the alert box is dismissed if it is appear.

So modify your DesiredCapabilities before initializing WebDriver to ignore this behavior by setting as follows :-

DesiredCapabilitiescapabilities= DesiredCapabilities.firefox()
    capabilities.setCapability(CapabilityType.UNEXPECTED_ALERT_BEHAVIOUR,"ignore");

Hope this will help you..

Post a Comment for "When Running Selenium Webdriver Test No Alert Appears"