【问题标题】:How to configure IEDriverServer for testing on IE8如何配置 IEDriverServer 以在 IE8 上进行测试
【发布时间】:2015-04-02 13:56:13
【问题描述】:

拜托,我使用 selenium webdriver Java 进行自动化测试。

为了在 IE 上进行测试,我做了:

**System.setProperty("webdriver.ie.driver",
                    "C:\\dev\\drivers\\IeDriver\\IEDriverServer.exe");

DesiredCapabilities sCaps = DesiredCapabilities.internetExplorer();
            sCaps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
sCaps.setJavascriptEnabled(true);
driver = new InternetExplorerDriver(sCaps);**

但是,我不知道如何配置所有版本的IE(从IE8开始)?

你能给我你的建议吗?

我为 IE 开发了这部分代码:DesiredCapabilities sCaps = DesiredCapabilities.internetExplorer(); sCaps.setCapability( InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, 真的); sCaps.setCapability( InternetExplorerDriver.ignoreProtectedModeSettings, 真的); //sCaps.setJavascriptEnabled(true); driver = new InternetExplorerDriver(sCaps);

提前致谢,

问候,

【问题讨论】:

    标签: java eclipse selenium selenium-webdriver


    【解决方案1】:

    在 IE 7 或更高版本的 Windows Vista 或 Windows 7 上

    1. 您必须将每个区域的保护模式设置设为相同的值。
    2. 所有区域的增强保护模式必须相同。 (我更喜欢禁用它,因为这是 IE 10 及更高版本的要求。) 此外,对于 IE 10 及更高版本,必须禁用“增强保护模式”。此选项位于 Internet 选项对话框的高级选项卡中。
    3. 必须将浏览器缩放级别设置为 100%,以便可以将本机鼠标事件设置为正确的坐标。

    以上步骤怎么做???

    看看这个视频:http://screencast.com/t/5nlxsrje4I。我已经展示了步骤。

    希望这会有所帮助。谢谢你:)

    【讨论】:

    • 非常感谢我配置了 IE 的选项并且我在 IE 上的测试有效,但是为了自动化这个我应该使用 DesiredCapabilities 吗?不是吗?
    • 我更新了问题中的代码,因为我在 IE 中使用了 DesiredCapabilities。请看最后。
    • 您已经设置了正确的功能@KhalidKsouri。 但是我告诉过的设置对于在 IE 上运行测试非常重要。 如果对您有帮助,请投票给答案。乐于助人:)
    • 谢谢,但我没有找到使用什么:ignoreProtectedModeSettings 和 DesiredCapabilities ?因为“ignoreProtectedModeSettings”没有变量。
    • InternetExplorerOptions ieOptions = new InternetExplorerOptions(); ieOptions.IgnoreZoomLevel = true; ieOptions.EnableNativeEvents = false; ieOptions.IntroduceInstabilityByIgnoringProtectedModeSettings = true; _driver = new InternetExplorerDriver(ieDriverServerLocation, ieOptions, TimeSpan.FromMilliseconds(tTimeouts)) 此代码将帮助您忽略保护模式设置
    【解决方案2】:

    您不能在同一台计算机上运行多个版本的 IE。

    如果您使用 Selenium Grid,最简单的方法是使用不同版本的 IE 将 Windows 节点连接到集线器,然后使用 RemoteWebDriver 而不是 InternetExplorerDriver。

    【讨论】:

    • 感谢您的回复。我使用 selenium webdriver。我应该怎么做才能在 IE8 上进行测试?
    • 您必须在安装了 IE8 的计算机上运行测试,并将 webdriver.ie.driver 系统属性指向 IE WebDriver。
    • 我尝试下载适用于 windows 7 64 位的 IE8 但我发现:
    • Windows Internet Explorer 8 用于 Windows Server 2003 SP2 Édition 64 位 Windows Internet Explorer 8 用于 Windows Vista 64 位和 Windows Server 2008 Édition 64 位 Windows Internet Explorer 8 用于 Windows Vista 和 Windows Server 2008
    • 拜托,如果我只使用 IE11,我应该如何调整我的代码?
    猜你喜欢
    • 2010-09-27
    • 1970-01-01
    • 2014-02-24
    • 1970-01-01
    • 1970-01-01
    • 2023-02-17
    • 1970-01-01
    • 2014-01-25
    • 1970-01-01
    相关资源
    最近更新 更多