-3

Please help me Tester, i am frustrated this point i have apply more and more code but no solution found again and same message show.

................................................................................ org.openqa.selenium.UnhandledAlertException: Unexpected modal dialog (text: Meal Added to Shopping List): Meal Added to Shopping List Build info: version: '2.53.0', revision: '35ae25b', time: '2016-03-15 16:57:40' System info: host: 'Saurabh', ip: '192.168.3.21', os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_65' Driver info: org.openqa.selenium.firefox.FirefoxDriver Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=46.0.1, platform=WINDOWS, nativeEvents=false, acceptSslCerts=true, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}] Session ID: 87eb9958-85a9-4571-8bbd-663fdaad2ad0

Saurabh Gupta
  • 139
  • 2
  • 4
  • 13
  • You need to be giving more than just the error you've recieved. Ideally you'd need to supply the section of your automation code which triggers the error, and if possible the code of what you're testing at that point to allow troubleshooting – Jsmith2800 Aug 03 '16 at 15:40

1 Answers1

0

You can try this:

    WebDriverWait wait = new WebDriverWait(driver, 3);
    wait.until(ExpectedConditions.alertIsPresent());
    Alert alert = driver.switchTo().alert();
    alert.accept();

Hope this helps!!

Ranjith's
  • 4,508
  • 5
  • 24
  • 40