InternetExplorerDriver缩放级别错误 [英] InternetExplorerDriver Zoom Level Error

查看:140
本文介绍了InternetExplorerDriver缩放级别错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试针对IE8运行测试,但是遇到了一个奇怪的问题:

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

  1. 在创建webdriver实例(driver = Selenium :: WebDriver.for:ie)时,IE启动,WebDriver引发异常:

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

启动Internet Explorer出现意外错误.浏览器缩放级别设置为0%"

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

IE似乎无法连接到IE驱动程序服务器,但是如果我手动刷新浏览器,它就可以正常连接.

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.

我的环境是带有IE Driver Server v2.25.3的Windows 7和IE8,我使用的是Ruby绑定.

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

有什么想法吗?

推荐答案

根据Jim Evans(硒开发人员之一)在

According to the answer given by Jim Evans (one of Selenium developers) in this thread at WebDriver User Group the code below should fix your problem.

DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
caps.setCapability("ignoreZoomSetting", true);
driver = new InternetExplorerDriver(caps);

这篇关于InternetExplorerDriver缩放级别错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆