9

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

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

同时,在特拉维斯方面,我看到了这一点:

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

我确实在 Sauce Labs 支持文档中找到了一个条目,表明这可能是由非常规端口引起的,但我在端口 443 上通过 HTTPS 运行我的应用程序,所以这似乎不是问题。

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

# 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 相同的问题。

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

4

2 回答 2

2

我在使用带有 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看起来他们正在使用重定向循环进行探测

于 2014-02-24T15:24:45.070 回答
1

我能够通过更改来解决这个问题:

base_url: https://localhost

base_url: https://realhostname

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

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

addons:
  hosts:
    - realhostname

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

于 2014-05-03T16:21:21.223 回答