Open dimkin-eu opened 4 years ago
@shawnlobo96 maybe you can help with this issue? :)
@dimkin-eu Can you execute the tests without Network Logs? Also, BrowserStack only supports secure Web Sockets so could you please confirm if you are using secure Web Sockets only?
@anthony-fdes , under secure WebSockets you mean wss://? then yes - they are used And yes, turning off network logs made ws working. This is quite nasty and not obvious :( Can this be fixed or at least mentioned on https://www.browserstack.com/local-testing/automate ?
Thank you for fast heads-up :)
Hey @dimkin-eu,
You can try adding the below capability:
'browserstack.wsLocalSupport': 'true'
This has been documented under https://www.browserstack.com/automate/capabilities. This should allow WebSocket connections with network logs enabled. The reason for using this capability is mentioned as:
Chrome browser v71 and above have changed the way PAC files are supported.
Use this capability to enable WSS (WebSocket Secure) connections to work with Network Logs on Chrome browser v71 and above.
If you are using localhost in your test, change it to bs-local.com
Note: This capability is only valid for Chrome browsers v71 and above.
I hope you find this useful :)
@shawnlobo96 , nice, will check :)
This needs some more things, if one testing locally and in Browserstack, will check this too
if AUT is using ws for communication - it fails when running on Browserstack, because fails to connect update - see the workaround in the end
Environment (please complete the following information):
To reproduce
npm install
and thennpm test
package.json bsSpec.js wdio.conf.jsSame happens, if BrowserstackLocal started as background service
./BrowserStackLocal --key somekey
Expected behavior test runs
Actual behavior
using localtesing ws connect fails
Workaround As turned out - network logging "turns off" ws communication