2

我想運行量角器和browserstack測試。 我已遵循this post 我在一個代理的背後。我已經安裝了browserstack地方,我用這個命令運行它:量角器瀏覽器堆棧連接ETIMEDOUT

BrowserStackLocal.exe -v -proxyHost proxy -proxyPort port QgNaPBMSMoZ5s5dx1WFH localhost,9000,0 

一切似乎工作東陽我有這樣的消息:

BrowserStackLocal v4.3 

Setting up proxy connection to cornillon:8000 
Proxy is configured 

Connecting to BrowserStack using WebSocket protocol... 
Platform supports WebSocket connections. 

You can now access your local server(s) in our remote browser. 

*** 
Please ensure your browser is configured to bypass proxy for "bs-local.com". 
*** 

Press Ctrl-C to exit 

然後我跑我一飲而盡任務量角器和我有這樣的錯誤:

C:\Users\toto\Desktop\myapp3>gulp protractor 
[16:11:44] Using gulpfile ~\Desktop\myapp3\gulpfile.js 
[16:11:44] Starting 'protractor'... 
[16:11:44] Finished 'protractor' after 6.9 ms 
Using the selenium server at http://hub.browserstack.com/wd/hub 
[launcher] Running 1 instances of WebDriver 

C:\Users\toto\Desktop\myapp3\node_modules\selenium-webdriver\http\index.js:174 
    callback(new Error(message)); 
     ^
Error: ETIMEDOUT connect ETIMEDOUT 208.52.180.201:80 
    at ClientRequest.<anonymous>  (C:\Users\toto\Desktop\myapp3\node_modules\selenium-webdriver\http\index.js:174:16) 
at emitOne (events.js:77:13) 
at ClientRequest.emit (events.js:169:7) 
at Socket.socketErrorListener (_http_client.js:259:9) 
at emitOne (events.js:77:13) 
at Socket.emit (events.js:169:7) 
at emitErrorNT (net.js:1253:8) 
at doNTCallback2 (node.js:441:9) 
at process._tickCallback (node.js:355:17) 
From: Task: WebDriver.createSession() 
at Function.webdriver.WebDriver.acquireSession_ (C:\Users\toto\Desktop\myapp3\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:157:22) 
at Function.webdriver.WebDriver.createSession (C:\Users\toto\Desktop\myapp3\node_modules\selenium-webdriver\lib\webdriver\webdriver.js:131:30) 
at [object Object].Builder.build (C:\Users\toto\Desktop\myapp3\node_modules\selenium-webdriver\builder.js:445:22) 
at [object Object].DriverProvider.getNewDriver (C:\Users\toto\Desktop\myapp3\node_modules\protractor\lib\driverProviders\driverProvider.js:38:7) 
at [object Object].Runner.createBrowser (C:\Users\toto\Desktop\myapp3\node_modules\protractor\lib\runner.js:186:37) 
at C:\Users\toto\Desktop\myapp3\node_modules\protractor\lib\runner.js:276:21 
at _fulfilled (C:\Users\toto\Desktop\myapp3\node_modules\protractor\node_modules\q\q.js:797:54) 
at self.promiseDispatch.done (C:\Users\toto\Desktop\myapp3\node_modules\protractor\node_modules\q\q.js:826:30) 
at Promise.promise.promiseDispatch (C:\Users\toto\Desktop\myapp3\node_modules\protractor\node_modules\q\q.js:759:13) 
at C:\Users\toto\Desktop\myapp3\node_modules\protractor\node_modules\q\q.js:525:49 
[launcher] Process exited with error code 1 

C:\Users\toto\Desktop\myapp3\gulpfile.js:352 
    .on('error', function(e) { throw e; }); 
          ^
Error: protractor exited with code 1 

這是我protractor.conf.js文件:

var proxy = 'http://proxy:port'; 

exports.config = { 
    capabilities: { 
     proxy: { 
      proxyType: 'manual', 
      httpProxy: proxy, 
      sslProxy: proxy, 
      noProxy: 'bs-local.com' 
     }, 

     'browserstack.user': 'toto', 
     'browserstack.key': 'key', // show on BrowserStack 

     // Needed for testing localhost 
     'browserstack.local' : 'true', 

     // Settings for the browser you want to test 
     // (check docs for difference between `browser` and `browserName` 
     'browserName' : 'chrome', 
     'version' : '43.0', 
     'os' : 'OS X', 
     'os_version' : 'Yosemite', 
     'resolution' : '1024x768' 
    }, 
    seleniumAddress: 'http://hub.browserstack.com/wd/hub', 
    specs: ['./src/app/**/*.spec.e2e.js'] 
}; 

這似乎是一個網絡問題,所以可能代理配置不當。

我可以請你幫忙嗎?

感謝

回答

0

既然你希望通過你的本地代理上運行BrowserStack測試,通過能力設置代理參數不會幫助,因爲它設置在遠程虛擬機的代理。根據您共享的conf文件,我相信您只希望配置代理主機和代理端口參數。我建議您使用global-tunnel節點模塊在您的量角器測試中設置代理。這應該可以幫助您通過網絡中的代理在BrowserStack上運行Protractor測試。

相關問題