question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow multiremote feature when combining browserstack with selenium standalone service

See original GitHub issue

Is your feature request related to a problem? Please describe.

unable to use the advantage of multi remote feature when combining browserstack with selenium standalone service, using multiremote feature is working fine when using appium service with selenium locally

Describe the solution you’d like Some enhancements for multi-remote feature are needed to allow different configuration when combining browserstack with selenium service

Describe alternatives you’ve considered Running it locally appium + selenium service, but still a drawback specially if you are planning for reliable CI/CD integration

Additional context the working caps when combining selenium with appium

caps.ChromeDesktopCaps = 
{
    port: 4444,
    path: '/wd/hub',
    capabilities: {
        browserName: 'chrome',
        acceptInsecureCerts: true,
    }
  }

caps.AndroidXCaps =
{
    port: 4728,
    path: '/',
    capabilities: {

      platformName: 'Android',
     'appium:deviceName': 'pixel2',
     'appium:avd': 'pixel2',
    'appium:app': 'src/test/resources/test.apk',
    'appium:platformVersion': '10',
    'appium:avdLaunchTimeout': 120000,
    'appium:avdReadyTimeout': 120000,
    'appium:uiautomator2ServerInstallTimeout' :120000,
    'appium:appWaitForLaunch': true,
    'appium:ensureWebviewsHavePages': true,
    'appium:disableWindowAnimation': true,
    'appium:autoGrantPermissions': true,
    'appium:clearSystemFiles': true,
    'appium:nativeWebScreenshot': true,

    }
}

caps.CrossCaps = 
{
    chromeDesktop: caps.ChromeDesktopCaps,
    androidClient: caps.AndroidXCaps
}

exports.config = {

  capabilities: caps.CrossCaps,

services: [
  ['selenium-standalone', {
      args: {
        seleniumArgs: ['-port', '4444']
      },
  }],  
  ['appium',{
    command : 'appium',
    args: {
        debugLogSpacing: true,
        sessionOverride: true,
        port: 4728,
        allowInsecure:'chromedriver_autodownload'
    },
  }]
],

caps when combining browserstack with selenium standalone

caps.ChromeDesktopCaps = 
{
    port: 4444,
     path: '/wd/hub',
    capabilities: {
        browserName: 'chrome',
        acceptInsecureCerts: true,
    }
  }

caps.AndroidXCaps =
{
    capabilities: {
      platformName: 'Android',
      'device': 'Samsung Galaxy S20',
      'os_version': '10.0',
      'project': 'App Android automation test',
      'build': ' APP Android Build',
      'name': 'APP - V 1.87.000',
      'app': 'bs://38d44087bd57d6dsfsddd083d382076e3f17',
      'browserstack.appium_version':'1.17.0',
      'autoGrantPermissions': true,
      'nativeWebScreenshot': true,
      'ensureWebviewsHavePages': true,
      'disableWindowAnimation': true

    }
}

caps.CrossCaps = 
{
    chromeDesktop: caps.ChromeDesktopCaps,
    androidClient: caps.AndroidXCaps
}

exports.config = {

  capabilities: caps.CrossCaps,


services: [
  ['selenium-standalone', {
      args: {
        seleniumArgs: ['-port', '4444']
      },
  }],  
  ['browserstack'],
],

console log error

Execution of 1 spec files started at 2020-09-30T20:48:34.630Z

2020-09-30T20:48:34.633Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-09-30T20:48:34.634Z DEBUG @wdio/utils:initialiseServices: initialise service "browserstack" as NPM package       
2020-09-30T20:48:34.653Z INFO @wdio/cli:launcher: Run onPrepare hook
2020-09-30T20:48:34.656Z INFO @wdio/browserstack-service: browserstackLocal is not enabled - skipping...
2020-09-30T20:48:46.961Z INFO @wdio/cli:launcher: Run onWorkerStart hook
2020-09-30T20:48:46.965Z INFO @wdio/local-runner: Start worker 0-0 with arg: wdio4.conf.js
[0-0] 2020-09-30T20:48:47.487Z INFO @wdio/local-runner: Run worker command: run
[0-0] 2020-09-30T20:48:48.394Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-09-30T20:48:48.396Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] 2020-09-30T20:48:48.397Z INFO webdriverio: Initiate new session using the ./protocol-stub protocol
[0-0] RUNNING in MultiRemote - C:\Users\amrka\Desktop\Work\Appium-wdio\src\test\specs\CrossPlatform_Suite.js
[0-0] 2020-09-30T20:48:48.426Z DEBUG @wdio/utils:initialiseServices: initialise service "selenium-standalone" as NPM package
2020-09-30T20:48:48.429Z DEBUG @wdio/utils:initialiseServices: initialise service "browserstack" as NPM package
[0-0] 2020-09-30T20:48:48.458Z DEBUG @wdio/local-runner:utils: init multiremote session
[0-0] 2020-09-30T20:48:48.459Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-09-30T20:48:48.459Z INFO webdriverio: Initiate new session using the webdriver protocol
[0-0] 2020-09-30T20:48:48.461Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
[0-0] 2020-09-30T20:48:48.461Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: { browserName: 'chrome', acceptInsecureCerts: true },
    firstMatch: [ {} ]
  },
  desiredCapabilities: { browserName: 'chrome', acceptInsecureCerts: true }
}
2020-09-30T20:48:48.473Z INFO webdriver: [POST] http://localhost:4444/wd/hub/session
2020-09-30T20:48:48.473Z INFO webdriver: DATA {
  capabilities: {
    alwaysMatch: {
      platformName: 'Android',
      device: 'Samsung Galaxy S20',
      os_version: '10.0',
      project: 'App Android automation test',
      build: 'APP Android Build',
      name: 'APP - V 1.87.000',
      app: 'bs://38d44087bd57d6701456456f5fdfddd083d382076e3f17',
      'browserstack.appium_version': '1.17.0',
      autoGrantPermissions: true,
      nativeWebScreenshot: true,
      ensureWebviewsHavePages: true,
      disableWindowAnimation: true
    },
    firstMatch: [ {} ]
  },
  desiredCapabilities: {
    platformName: 'Android',
    device: 'Samsung Galaxy S20',
    os_version: '10.0',
    project: 'App Android automation test',
    build: 'APP Android Build',
    name: 'APP - V 1.87.000',
    app: 'bs://38d44087bd57d6701f456455fdfddd083d382076e3f17',
    'browserstack.appium_version': '1.17.0',
    autoGrantPermissions: true,
    nativeWebScreenshot: true,
    ensureWebviewsHavePages: true,
    disableWindowAnimation: true
  }
}
[0-0] 2020-09-30T20:48:48.562Z DEBUG webdriver: request failed due to status 13
[0-0] 2020-09-30T20:48:48.562Z ERROR webdriver: Request failed with status 500 due to unknown error: Illegal key values seen in w3c capabilities: [app, autoGrantPermissions, browserstack.appium_version, build, device, 
disableWindowAnimation, ensureWebviewsHavePages, name, nativeWebScreenshot, os_version, project]
[0-0] 2020-09-30T20:48:48.562Z ERROR webdriver: unknown error: Illegal key values seen in w3c capabilities: [app, autoGrantPermissions, browserstack.appium_version, build, device, disableWindowAnimation, ensureWebviewsHavePages, name, nativeWebScreenshot, os_version, project]
    at getErrorFromResponseBody (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriver\build\utils.js:121:10)
    at WebDriverRequest._request (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriver\build\request.js:149:56)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
    at async startWebDriverSession (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriver\build\utils.js:41:16)
    at async Function.newSession (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriver\build\index.js:44:23)
    at async remote (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriverio\build\index.js:75:20)
    at async C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriverio\build\index.js:104:22
    at async Promise.all (index 1)
    at async multiremote (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriverio\build\index.js:103:3)
    at async initialiseInstance (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\@wdio\runner\build\utils.js:81:19)
2020-09-30T20:48:48.563Z ERROR @wdio/runner: Error: Failed to create session.
Illegal key values seen in w3c capabilities: [app, autoGrantPermissions, browserstack.appium_version, build, device, disableWindowAnimation, ensureWebviewsHavePages, name, nativeWebScreenshot, os_version, project]     
Make sure to add vendor prefix like "goog:", "appium:", "moz:", etc to non W3C capabilities.
See more https://www.w3.org/TR/webdriver/#capabilities
    at startWebDriverSession (C:\Users\amrka\Desktop\Work\Appium-wdio\node_modules\webdriver\build\utils.js:45:11)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
[0-0]  Error:  Failed to create session.
Illegal key values seen in w3c capabilities: [app, autoGrantPermissions, browserstack.appium_version, build, device, disableWindowAnimation, ensureWebviewsHavePages, name, nativeWebScreenshot, os_version, project]     
Make sure to add vendor prefix like "goog:", "appium:", "moz:", etc to non W3C capabilities.
See more https://www.w3.org/TR/webdriver/#capabilities
2020-09-30T20:48:48.686Z DEBUG @wdio/local-runner: Runner 0-0 finished with exit code 1
[0-0] FAILED in MultiRemote - C:\Users\amrka\Desktop\Work\Appium-wdio\src\test\specs\CrossPlatform_Suite.js
2020-09-30T20:48:48.688Z INFO @wdio/cli:launcher: Run onComplete hook
2020-09-30T20:48:48.701Z INFO @wdio/selenium-standalone-service: shutting down all browsers

Spec Files:      0 passed, 1 failed, 1 total (100% completed) in 00:00:14

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:38 (21 by maintainers)

github_iconTop GitHub Comments

2reactions
hieuxlucommented, Oct 8, 2020

@christian-bromann Okay I think I was able to fix this. Multiremote capabilities do allow overriding hostname, protocol and port. After my fix, below configuration works, will submit a PR later

    capabilities: {
        browserA: {
            protocol: 'http',
            hostname: 'localhost',
            port: 4445,
            capabilities: {
                browserName: 'chrome',
            },
        },
        browserB: {
            capabilities: {
                browserName: 'chrome',
                'bstack:options': bstackOptions
            },
        },
    },
1reaction
hieuxlucommented, Oct 14, 2020

Indeed I could reproduce the 404 locally. There’s 2 404s, one on start of session and the 2nd on session close. Could you create a new issue for this, thanks. @Amrkamel1

Sorry, I must’ve overlooked the logs before.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Multiremote - WebdriverIO
Multiremote makes it easy and convenient to control multiple browsers, whether you want them doing the same thing in parallel, or different things...
Read more >
Selenium WebDriver capabilities for running tests on ...
Allows the user to specify an identifier for the test run. Example: logintest. local. Use this capability to test your locally hosted websites...
Read more >
webdriverio/webdriverio - Gitter
@GeeChao any idea...as in package.json we define "wdio-selenium-standalone-service": <version>. @GeeChao it fetches the selenium jar and chrome driver ...
Read more >
Automated End-to-End Multi-Remote Testing Using ... - Teltoo
Automated End-to-End Multi-Remote Testing Using Webdriverio and Selenium ... Selenium allows us to control browser input remotely in order to test all the ......
Read more >
WebDriver - CodeceptJS
WebDriver requires Selenium Server and ChromeDriver/GeckoDriver to be ... Enable wdio plugin in plugins list and add browserstack service:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found