Pages

Showing posts with label InternetExplorerDriver. Show all posts
Showing posts with label InternetExplorerDriver. Show all posts

Wednesday, 7 March 2012

Why am getting security message while instantiating IE WebDriver?

Security Message:“Protected Mode must be set to the same value (enabled or disabled) for all zones.”


Solutions 1:


Set manually the protected mode to the same value (enabled or disabled) for all zones in ‘Internet Options’ —> ‘Security’ Tab.


Solution 2:


Set a capability while instantiating IE driver, as shown below:


 DesiredCapabilities capability=DesiredCapabilities.internetExplorer();
capability.setCapability(
InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_
IGNORING_SECURITY_DOMAINS, true);
WebDriver webdriver = new InternetExplorerDriver(capability);

Tuesday, 7 February 2012

How can I instantiate InternetExplorerDriver?

The InternetExplorerDriver can be instantiated as below:


WebDriver driver = new InternetExplorerDriver(); // Instantiate the class - org.openqa.selenium.ie.InternetExplorerDriver

Sample code(Java Binding):


package tests;

import org.openqa.selenium.WebDriver;
import org.openqa.selenium.ie.InternetExplorerDriver;

public class InternetExplorerDriverSample {
public static void main(String[] args) {
// Instantiate the InternetExplorerDriver
WebDriver driver = new InternetExplorerDriver();

// Visit the Selenium-WebDriver FAQ site
driver.get("http://seleniumwebdriverfaq.tumblr.com/");

// Print the title of the page - It should print "Selenium-WebDriver FAQ's"
System.out.println("Title of the page is: " + driver.getTitle());

//Close the browser window
driver.close();

//Quit the driver
driver.quit();

}
}