Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in DevOps and Agile by (19.7k points)

I'm trying to run tests against IE8 but I've encountered a strange issue:

  1. When creating the webdriver instance (driver = Selenium::WebDriver.for :ie), IE starts up and an exception is thrown by WebDriver:

    "Unexpected error launching Internet Explorer. Browser zoom level was set to 0%"

  2. IE seems to show a failure to connect to the IE Driver Server but if I refresh the browser manually, it connects just fine.

    I have checked online and only two other people seem to have reported this. One possible solution was to ensure that all zones have the same "protected mode" settings, which they do.

    My environment is Windows 7 and IE8 with IE Driver Server v2.25.3 and I'm using the Ruby bindings.

Any ideas?

1 Answer

0 votes
by (62.9k points)

Selenium identifies the elements only if the browser zoom is 100% ie. default. If it's different then the wrong element will be selected and actions will be performed on them. So the below code would be used to set the zoom to the default value, the robust and full proof way:

DesiredCapabilities capabilities = DesiredCapabilities.internetExplorer();

capabilities.setCapability(InternetExplorerDriver.IGNORE_ZOOM_SETTING, true);

System.setProperty("webdriver.ie.driver","D:\\IEDriverServer_Win32_2.33.0\\IEDriverServer.exe");

WebDriver driver= new InternetExplorerDriver(capabilities);

driver.get(baseURl);

driver.findElement(By.tagName("html")).sendKeys(Keys.chord(Keys.CONTROL,"0"));

//This will be added to set the zoom to default value

//which will Identify your correct elements and then go ahead writing the testing part for the code.

Hope this helps.

Browse Categories

...