How to handle https security warning in IE for Selenium WebDriver + RC & How to solve the Unhandled exception: Modal dialog present
In Selenium Webdriver whenever we try to launch the IE we get the Security Warning pop-up.
Handling security warning pop-up can be done in two ways.
1. Using Robot Script as follows:
try {
(new Robot()).keyPress(java.awt.event.KeyEvent.VK_ENTER);
(new Robot()).keyRelease(java.awt.event.KeyEvent.VK_ENTER);
} catch (AWTException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
2. Adding the website url in the Trusted websites
Open Internet Explorer by clicking the Start button . In the search box, type Internet Explorer, and then, in the list of results, click Internet Explorer.
Navigate to the website that you want to add to a specific security zone.
Click the Tools button, and then click Internet Options.
Click the Security tab, and then click a security zone (Local intranet, Trusted sites, or Restricted sites).
Click Sites.
If you clicked Local intranet in step 4, click Advanced.
The website should be shown in the Add this website to the zone field. Click Add.
If the site is not a secure site (HTTPS), clear the Require server verification (https:) for all sites in this zone check box.
Click Close, and then click OK (or click OK twice if you clicked Local intranet in step 4).
0 comments:
Post a Comment