Join 500+ Software Testing professionals. Solve problem and get your problem solved. Register Now!

0
how do I handle model dialog?

Solved 1 Answers 212 Views Selenium
0 1

While executing script I get following error.

 

org.openqa.selenium.UnhandledAlertException: Modal dialog present: Logged in

Build info: version: '2.44.0', revision: '76d78cf', time: '2014-10-23 20:03:00'

System info: host: 'Sandeeprams-MacBook-Pro.local', ip: '192.168.1.252', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.9.5', java.version: '1.6.0_65'

Session ID: 2bf83866-d826-bb47-ad12-e78a2eb8247f

Driver info: org.openqa.selenium.firefox.FirefoxDriver

Capabilities [{platform=MAC, acceptSslCerts=true, javascriptEnabled=true, browserName=firefox, rotatable=false, locationContextEnabled=true, version=33.1.1, cssSelectorsEnabled=true, databaseEnabled=true, handlesAlerts=true, nativeEvents=false, webStorageEnabled=true, applicationCacheEnabled=true, takesScreenshot=true}]

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)

at org.openqa.selenium.remote.ErrorHandler.createUnhandledAlertException(ErrorHandler.java:185)

at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:152)

at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)

at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)

at org.openqa.selenium.remote.RemoteWebDriver.findElementByName(RemoteWebDriver.java:425)

at org.openqa.selenium.By$ByName.findElement(By.java:299)

at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)

at com.mail.google.Gmail_Automation_no_parametrization.test(Gmail_Automation_no_parametrization.java:87)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

at java.lang.reflect.Method.invoke(Method.java:597)

at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)

at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)

at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)

at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)

at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)

at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)

at org.testng.TestRunner.privateRun(TestRunner.java:767)

at org.testng.TestRunner.run(TestRunner.java:617)

at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)

at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)

at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)

at org.testng.SuiteRunner.run(SuiteRunner.java:240)

at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)

at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)

at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)

at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)

at org.testng.TestNG.run(TestNG.java:1057)

at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)

at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)

at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)

1 Answer

0
Best answer
0
You have to handle alert.

Use

Alert alert = driver.switchto().alert();
alert.accept()
answered by
selected by

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:
To avoid this verification in future, please log in or register.
...