【问题标题】:Travis-CI + Sauce Connect + Behat: Unable to get Internet Explorer to run testsTravis-CI + Sauce Connect + Behat:无法让 Internet Explorer 运行测试
【发布时间】:2014-03-17 16:33:50
【问题描述】:

我让 Travis-CI 运行 Sauce Connect 来运行 Behat 测试。如果我告诉 Sauce 在 Windows 7 上使用 Firefox 26,一切正常。但如果我将浏览器更改为 Internet Explorer(Sauce Labs 在 Windows 7 上提供的三个版本中的任何一个,即 IE8、IE9 和 IE10 ),那么它就不起作用了。

the Sauce page that shows the IE browser test,它显示了一个长视频,除了This is the initial start page for the WebDriver server.,页面顶部显示的错误消息显示浏览器截图是:Test did not see a new command for 90 seconds. Timing out.但是,截屏超过13分钟很长,所以它至少会收到一些命令,即使它从未对它们采取行动。

与此同时,在 Travis 方面,我看到了这一点:

2014-02-18 04:34:13,124 - Request started: GET http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/disallowedcertstl.cab?f20efc77fc170e42
2014-02-18 04:34:13,211 - GET http://ctldl.windowsupdate.com/msdownload/update/v3/static/trustedr/en/disallowedcertstl.cab?f20efc77fc170e42 -> 200 (88ms, 6356 bytes)
2014-02-18 04:34:13,417 - Request started: GET https://ieonline.microsoft.com/iedomainsuggestions/ie10/201402/suggestions.en-US
2014-02-18 04:34:13,503 - GET https://ieonline.microsoft.com/iedomainsuggestions/ie10/201402/suggestions.en-US -> 200 (87ms, 18176 bytes)
No output has been received in the last 10 minutes, this potentially indicates a stalled build or something wrong with the build itself.
The build has been terminated

我确实发现 an entry in the Sauce Labs support docs 表明这可能是由非常规端口引起的,但我在端口 443 上通过 HTTPS 运行我的应用程序,所以这似乎不是问题。

这是我的 Behat YAML 配置文件,用于通过 Sauce 运行 Internet Explorer 9:

# Use this profile to run tests on Sauce against the Travis-CI instance
default:
    context:
        class: "FeatureContext"
    extensions:
        Behat\MinkExtension\Extension:
            base_url: https://localhost
            default_session: saucelabs
            javascript_session: saucelabs
            saucelabs:
                browser: "internet explorer"
                capabilities:
                    platform: "Windows 7"
                    version: 9

我正在运行 Behat 2.5.2,尽管我在 2.4.x 上遇到了同样的问题。

我不确定从这里去哪里或做什么。我的下一步应该是什么?

【问题讨论】:

  • 似乎端口 443 应该可以工作,但我很好奇您是否在像 8000 这样的非 SSL 端口上看到相同的行为?更改应用端口和检查是否容易?
  • 尝试使用 SSL 端口 8000 并得到相同的结果:saucelabs.com/tests/674fb14952724a4e88cc1b24084afa32 适用于 Firefox,不适用于 IE。也可以尝试在端口 8000 上使用 HTTP 而不是 HTTPS,但这种更改涉及更多......

标签: internet-explorer automated-tests behat travis-ci saucelabs


【解决方案1】:

我在使用带有 saucelabs 的 Internet Explorer 时遇到了同样的问题。我正在发送一个 POST /session 来请求一个新会话,并期待返回一个 {object} 一个对象,该对象根据 Json 有线协议描述会话的功能。相反,除了一个标头之外,什么都没有被发回:

                                                              Transfer-Encoding 
                                                                      "chunked" 
                                                                           Date 
                                                "Mon, 24 Feb 2014 15:19:06 GMT" 
                                                                   Content-Type 
                                                                    "text/html" 
                                                                       Location 
"http://ondemand.saucelabs.com/wd/hub/session/865ae26f6b5c461c9a30f3d1454f486a" 
                                                                         Server 
                                                                 "monocle/0.26" 
                                                                         status 
                                                                          "302" 
                                                                  statusMessage 
                                                                        "Found" 

该位置包含我能够继续我的会话的会话 ID。

从 Twitter 提要 https://twitter.com/sauceops 看来,他们遇到了带有重定向循环的探针

【讨论】:

    【解决方案2】:

    我可以通过改变来解决这个问题:

    base_url: https://localhost
    

    base_url: https://realhostname
    

    在 Behat\MinkExtension\Extension: 部分的 behat 配置中。

    使用 hosts 插件在 .travis.yml 文件中设置此主机名

    addons:
      hosts:
        - realhostname
    

    我相信这与通过 localhost 的酱汁连接完成的额外代理有关,这在底部提到:https://saucelabs.com/docs/connect 我不知道为什么这只影响 IE,但这个解决方案似乎有效。

    【讨论】:

      猜你喜欢
      • 2017-09-14
      • 1970-01-01
      • 1970-01-01
      • 2018-03-02
      • 2014-01-19
      • 2013-09-04
      • 2016-05-09
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多