seleniumprotractore2e-testinggetusermediabrowserstack

How can I pass a fake media stream to safari IOS in browserStack capability?


I am using protractor and selenium with browser stack and trying to automate a webrtc web application, I need to get rid of browser asking for permission and using a fake stream instead of real camera and mic as available in chrome.

I have tried using these options they both do not work.

Option 1:

    var capabilities = {
    'browserName': 'iPhone',
    'device': 'iPhone 6S',
    'realMobile': 'true',
    'os_version': '11.4',
    "media.navigator.permission.disabled": true,
    "media.navigator.streams.fake": true
  };

Option 2

    var capabilities = {
    'browserName': 'iPhone',
    'device': 'iPhone 6S',
    'realMobile': 'true',
    'os_version': '11.4',
    'safariOptions': {
      'args': ["--use-fake-ui-for-media-stream", '--use-fake-device-for-media-stream']
    }
  };

For building options I use:

var driver = new webdriver.Builder()
usingServer('http://hub-cloud.browserstack.com/wd/hub').
withCapabilities(capabilities).
build();

Solution

  • Currently, there is no such BrowserStack specific custom capability to pass fake media stream on Safari. Also, passing fake stream is not yet supported on Safari browsers. You can read about the issues below:

    https://github.com/web-platform-tests/results-collection/issues/125

    https://github.com/web-platform-tests/wpt/issues/7424

    Also, there seem to be no such arguments supported for Safari browser. I reviewed the same in the sample SafariOptions examples here