browsertime icon indicating copy to clipboard operation
browsertime copied to clipboard

Unable to start Android session on remote server (Browserstack)

Open sk13man opened this issue 6 years ago • 6 comments

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:[email protected]/wd/hub", "capabilities": { "browserName" : "chrome", "device" : "SamsungGalaxyS8", "realMobile" : "true", "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 18:03:30] ERROR: [browsertime] BrowserError: Appium error: unknown error: unhandled inspector error: {"code":-32601,"message":"'Browser.setWindowBounds' wasn't found"} (Session info: chrome=76.0.3809.89) (Driver info: chromedriver=76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864}),platform=Linux 3.19.8-100.fc20.x86_64 x86_64) (Session info: chrome=76.0.3809.89) (Driver info: chromedriver=76.0.3809.68 (420c9498db8ce8fcd190a954d51297672c1515d5-refs/branch-heads/3809@{#864}),platform=Linux 3.19.8-100.fc20.x86_64 x86_64) at SeleniumRunner.start (/Users/sk13man/Documents/GitHub/qa_automation_ts/node_modules/sitespeed.io/node_modules/browsertime/lib/core/seleniumRunner.js:121:13) at process._tickCallback (internal/process/next_tick.js:68:7) [2019-10-22 18:03:33] DEBUG: [browsertime] Closed the browser. [2019-10-22 18:03:33] ERROR: [browsertime] No data to collect Link to Appium logs - https://gist.github.com/sk13man/26c640060d184aa35d60105eae22065c

If added android : true to config - got another error [2019-10-22 18:12:18] 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 18:12:18] ERROR: TypeError: Cannot read property 'id' of undefined at Android.initConnection (/Users/sk13man/Documents/GitHub/qa_automation_ts/node_modules/sitespeed.io/node_modules/browsertime/lib/android/index.js:20:28) at process._tickCallback (internal/process/next_tick.js:68:7)

sk13man avatar Oct 22 '19 15:10 sk13man

Hi @sk13man yeah, I think has changed over time. I think a flag to turn off setting the window position should do it.

Best Peter

soulgalore avatar Oct 24 '19 06:10 soulgalore

I tried this solution. Did not help

sk13man avatar Nov 12 '19 15:11 sk13man

The problem is that when we use Chrome we heavily use the Chrome devtools protocol using https://github.com/cyrus-and/chrome-remote-interface since the Selenium support is limited for CDP (you can set but not get if I remember correctly).

Is there away to get the ip/host to use for CDP from Browserstack? Setting it to hub-cloud.browserstack.com doesn't seem to work.

soulgalore avatar Nov 29 '19 23:11 soulgalore

To make this work someone need to add https://github.com/sitespeedio/selenium/blob/4a71646fc54880025217da8b35b69be35482d0b4/chrome.js#L821-L836 into Selenium. At the moment Selenium only support sending a devtools command, but we also get information from devtools. We used to run our own "fixed" version of Selenium but gave that up because wanted to run latest stable (or at least latest release) and then move over to the current setup.

soulgalore avatar Dec 01 '19 18:12 soulgalore

That is merged in Selenium but not released yet.

soulgalore avatar Nov 10 '20 14:11 soulgalore

This is merged in Selenium so maybe we should have a new go and test if it works.

soulgalore avatar Apr 12 '21 06:04 soulgalore

I wonder my change got merged in Selenium long time ago, best case it just works now. I don't have a Browserstack account. If you have and this do not work, please ping the issue so we can re-open it.

soulgalore avatar Dec 17 '23 05:12 soulgalore