【问题标题】:Running IE using selenium webdriver使用 selenium webdriver 运行 IE
【发布时间】:2017-09-17 16:27:44
【问题描述】:

如果有人可以帮助编写下面的代码,我将不胜感激

打包 IEProjects;

导入 org.openqa.selenium.WebDriver; 导入 org.openqa.selenium.ie.InternetExplorerDriver;

public class startIE {



          public static void main(String[] args) {

                System.setProperty("webdriver.ie.driver", "C:\\IEDriverServer_Win32_3.3.0\\IEDriverServer.exe");
                WebDriver driver = new InternetExplorerDriver();              
                driver.get("http://www.google.com");

            }

        }

我得到以下结果

Started InternetExplorerDriver server (32-bit)
3.3.0.0
Listening on port 29209
Only local connections are allowed
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: Unexpected error launching Internet Explorer. Browser zoom level was set to 150%. It should be set to 100% (WARNING: The server did not provide any stacktrace information)

它启动 IE 并没有执行该操作。下面是IE页面上打印的内容

This is the initial start page for the WebDriver server. http://localhost:41380/

【问题讨论】:

    标签: eclipse selenium firefox


    【解决方案1】:

    错误信息描述性很强,IEDriver 有一组先决条件:

    https://github.com/SeleniumHQ/selenium/wiki/InternetExplorerDriver#required-configuration

    注意:

    • 必须将浏览器缩放级别设置为 100%,以便可以将本机鼠标事件设置为正确的坐标。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-02-20
      • 2019-05-08
      • 1970-01-01
      • 2017-09-18
      • 1970-01-01
      • 2015-03-27
      • 1970-01-01
      • 2018-05-08
      相关资源
      最近更新 更多