简体   繁体   English

机器人框架Internet Explorer无法打开

[英]Robot Framework Internet explorer not opening

I am writing some test cases in the Robot Framework using Ride. 我正在使用Ride在Robot Framework中编写一些测试用例。 I can run the tests on both Chrome and Firefox, but for some reason Internet Explorer is not working. 我可以在Chrome和Firefox上运行测试,但由于某种原因,Internet Explorer无法运行。

I have tested with the iedriverServer.exe (32bit version 2.47.0.0). 我已经使用iedriverServer.exe(32位版本2.47.0.0)进行了测试。

One thing to add is that I am using a proxy. 要添加的一件事是我正在使用代理。 When I disable the proxy in IE and enable the automatic proxy configuration... IE can start up. 当我在IE中禁用代理并启用自动代理配置时...... IE可以启动。 But it can not load the website. 但它无法加载网站。 For Chrome and FF the proxy is working fine. 对于Chrome和FF,代理工作正常。

Error message: WebDriverException: Message: Can not connect to the IEDriver. 错误消息:WebDriverException:消息:无法连接到IEDriver。

I have also encountered the same problem.Below are the steps which i have followed. 我也遇到了同样的问题。下面是我所遵循的步骤。

1.I have enabled the proxy in IE. 1.我在IE中启用了代理。

2.Set environmental variable no_proxy to 127.0.0.1 before launching the browser Ex: Set Environmental Variable no_proxy 127.0.0.1 2.在启动浏览器之前将环境变量no_proxy设置为127.0.0.1 Ex:设置环境变量no_proxy 127.0.0.1

3.Set all the internet zones to same level(medium to high) expect restricted sites Open browser>Tools>Internet Options>Security Tab 3.将所有互联网区域设置为相同级别(中等到高),期望受限制的站点打开浏览器>工具> Internet选项>安全选项卡

4.Enable "Enable Protected mode" in all zones 4.在所有区域中启用“启用保护模式”

Please let me know your feedback. 请告诉我您的反馈意见。

I had the same issue because my network environment is quite "hostile" and I have to deal with NTLM proxy and limited access policies. 我有同样的问题,因为我的网络环境非常“敌对”,我必须处理NTLM代理和有限的访问策略。

To solve this, no_proxy and webdriver.ie.driver environment variables must be properly setted: 要解决此问题,必须正确设置no_proxywebdriver.ie.driver环境变量:

Set Environment Variable    no_proxy    127.0.0.1
Set Environment Variable    webdriver.ie.driver    ${local_ie_driver}

... before you call for IE to open, like in this little example: ...在你打开IE之前,就像在这个小例子中一样:

*** Settings ***
Library           Selenium2Library
Library           OperatingSystem

*** Variables ***
${url_google}     http://www.google.com/
${local_ie_driver}    D:${/}PortableApps${/}SeleniumIEWebDriver${/}IEDriverServer.exe

*** Test Cases ***
Google for macarronada using IE
    Set Environment Variable    no_proxy    127.0.0.1
    Set Environment Variable    webdriver.ie.driver    ${local_ie_driver}
    Open Browser    ${url_google}    ie
    Wait Until Page Contains    Google
    Input Text    id=lst-ib    macarronada
    Click Button    name=btnG
    Wait Until Page Contains    macarronada
    Close Browser

Hope it can help you. 希望它可以帮到你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM