Bharat Mane Bharat Mane - 1 year ago 118
Java Question

How to handle modal dialog box in Selenium WebDriver with Java?

There is a scenario where I get the modal dialog box when I tried to login with Twitter.

Launch Url -> click on Login button -> it opens modal dialog box.

I am not able to handle this scenario because "webdriver" is not getting access to the dialog box. Is there any way to handle this?

Answer Source

just write the following code after click on login button:

Thread.sleep(3000); //i use here wait implicit wait. Try to use explicit wait here.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download