【问题标题】:browserstack connection issue浏览器堆栈连接问题
【发布时间】:2016-08-23 07:40:27
【问题描述】:

我创建了一个测试帐户来开始使用 browserStack。我关注了这里的页面:Running Protractor tests on Browserstack Automate,这真的很有帮助。

但是当我开始我的测试时,我得到了这个:

[09:32:46] I/hosted - Using the selenium server at http://hub-cloud.browserstack.com/wd/hub
[09:32:46] I/launcher - Running 1 instances of WebDriver
[09:32:47] E/launcher - Error code: 135
[09:32:47] E/launcher - Error message: ECONNREFUSED connect ECONNREFUSED 104.20.3.155:80
[09:32:47] E/launcher - Error: ECONNREFUSED connect ECONNREFUSED 104.20.3.155:80

更新!

然后我补充说: 'webDriverProxy': 'https://proxy.myerver.de:1234',

现在我明白了:

[10:35:04] I/hosted - Using the selenium server at https://hub-cloud.browserstack.com/wd/hub
[10:35:04] I/launcher - Running 1 instances of WebDriver
[10:35:04] E/launcher - EPROTO write EPROTO
[10:35:04] E/launcher - Error: EPROTO write EPROTO

这是什么意思?我没有任何要求。我只是打开一个页面,点击一个元素就可以了。

【问题讨论】:

    标签: connection protractor browserstack


    【解决方案1】:

    尝试使用Node Tunnel 模块指定代理详细信息。您可以覆盖所有 https 请求以使用如下代理:

    var tunnel = require('tunnel'), https = require('https');
    
    var tunnelingAgent = tunnel.httpsOverHttps({
      proxy: {
        host: 'proxy.myerver.de',
        port: 1234
      }
    });
    
    var oldRequest = https.request;
    https.request = function(options){
        options.agent = tunnelingAgent;
        return oldRequest(options);
    }
    

    警告:未经测试的代码:)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-02-08
      • 1970-01-01
      • 2011-07-19
      • 1970-01-01
      相关资源
      最近更新 更多