sitespeedio / browsertime

Measure and Optimize Web Performance
https://www.sitespeed.io/documentation/browsertime/
Apache License 2.0
602 stars 137 forks source link

Unable to connect to debugging port on remote server #970

Closed sk13man closed 4 years ago

sk13man commented 4 years ago

sitespeed.io version = 10.2.0 iOS = Catalina 10.15

Trying to run simple test module.exports = async function (context, commands) { return commands.measure.start('https://google.com'); };

speedsite.config.json

`{ "browsertime":{ "iterations": 1, "selenium": { "url": "http://user:key@hub-cloud.browserstack.com/wd/hub", "capabilities": { "browserName" : "chrome", "browserstack.console":"info", "browserstack.networkLogs": true, "browserstack.appium_version" : "1.6.5", "name": "Sitespeed.io performance audit", "enablePerformanceLogging": true } },

"visualMetrics": false, "video": false, "headless": false, "screenshot": true } } `

Running with NPM script

"test:perf": "sitespeed.io ./src/integration/performance/perf.js -n=1 --config=speedtest.config.json --multi",

Got an error

[2019-10-22 19:21:30] INFO: Versions OS: darwin 19.0.0 nodejs: v10.16.3 sitespeed.io: 10.2.0 browsertime: 6.1.3 coach: 4.0.2 [2019-10-22 19:21:31] INFO: Running tests using Chrome - 1 iteration(s) [2019-10-22 19:21:47] ERROR: Error: connect ECONNREFUSED 127.0.0.1:9222 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14) [2019-10-22 19:21:48] ERROR: No data to collect [2019-10-22 19:21:48] ERROR: TypeError: Cannot read property 'close' of undefined at ChromeDevtoolsProtocol.close (/Users/sk13man/Documents/GitHub/qa_automation_ts/node_modules/sitespeed.io/node_modules/browsertime/lib/chrome/webdriver/chromeDevtoolsProtocol.js:181:27) at ChromeDelegate.onStop (/Users/sk13man/Documents/GitHub/qa_automation_ts/node_modules/sitespeed.io/node_modules/browsertime/lib/chrome/webdriver/chromeDelegate.js:430:28) at Engine.runByScript (/Users/sk13man/Documents/GitHub/qa_automation_ts/node_modules/sitespeed.io/node_modules/browsertime/lib/core/engine/index.js:136:41) at process._tickCallback (internal/process/next_tick.js:68:7)

soulgalore commented 4 years ago

Hmm, we setup CDP to localhost and use chrome-remote-interface instead of Selenium CDP since the selenium connection only can set values at the moment (at least for JavaScript). We used our own hacked version for a while to fix it but then turned to chrome-remote-interface.

sk13man commented 4 years ago

@soulgalore maybe some walkaround exists?

soulgalore commented 4 years ago

Closing in favour of #969