【问题标题】:When running webdriver with IE browser, I'm getting message “Only local connections are allowed” although browser launches properly使用 IE 浏览器运行 webdriver 时,尽管浏览器正常启动,但我收到消息“仅允许本地连接”
【发布时间】:2016-07-27 07:10:33
【问题描述】:

我的代码在下面

System.setProperty("webdriver.ie.driver", "C:\\Selenium_Software\\IEDriverServer.exe");
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);      
driver = new InternetExplorerDriver(capabilities);
driver.get("http://10.32.147.151/RoSServer/WebClient/DoculiveSimulationExt.asp");
WD.wait(4);
flag=IsObjectPresent.byXpath("//table[@id='AutoNumber1']/tbody/tr[2]/td[6]/input[3]", true);
Click.byXpath("//table[@id='AutoNumber1']/tbody/tr[2]/td[6]/input[3]");

我收到此错误:

启动 InternetExplorerDriver 服务器(64 位)2.53.1.0

监听 5069 端口

只允许本地连接

【问题讨论】:

  • 您可以参考以下链接中的类似查询LINK
  • 实际上我浏览了你粘贴的链接。它与 chromdriver 无关。
  • 我也采用了与 selenium 站点兼容的 IEdriver。但我仍然遇到错误。我已经尝试了该链接上给出的所有解决方案

标签: java selenium selenium-iedriver


【解决方案1】:

尝试:

string DRIVER_PATH = @"C:\Selenium_Software\";

driver = new InternetExplorerDriver(DRIVER_PATH);
driver.get("http://10.32.147.151/RoSServer/WebClient/DoculiveSimulationExt.asp");
...

【讨论】:

  • InternetExplorerDriver 接受功能而不是字符串
  • InternetExplorerDriver(String) - 使用包含 IEDriverServer.exe 的目录的指定路径初始化 InternetExplorerDriver 类的新实例。
  • 尝试查看 selenium api 以更好地理解 selenium 功能:seleniumhq.github.io/selenium/docs/api/dotnet/index.html
  • 是的尝试了这个解决方案,但不知何故它没有在代码推荐中显示 InternetExplorerDriver(String) 构造函数,并且使用它会引发错误。它显示未定义的构造函数。
  • 我明白了,您使用 java .. 尝试初始化 InternetExplorerDriverService 服务对象并在该对象中定义驱动程序路径,然后将其传递给驱动程序初始化
【解决方案2】:

People say “这只是一条信息性消息。该消息告诉您...驱动程序可执行文件将只接受来自本地计算机的连接。”

【讨论】:

    猜你喜欢
    • 2014-09-24
    • 2023-04-06
    • 1970-01-01
    • 2021-11-23
    • 1970-01-01
    • 2016-11-08
    • 2016-07-09
    • 2011-05-06
    相关资源
    最近更新 更多