selenium-standalone icon indicating copy to clipboard operation
selenium-standalone copied to clipboard

[email protected] is not accepting chromeOptions as capabilities.

Open bstratx opened this issue 9 years ago • 3 comments

Expected Behavior

I expect that selenium-standalone package should accept this as a legit desired capabilities. This indeed worked in [email protected]

capabilities: [

// local chrome mobile
{
  browserName: 'chrome',
  chromeOptions: {
    args: ['disable-infobars', 'incognito'],
    mobileEmulation: {
      'deviceMetrics': { 'width': 360, 'height': 640, 'pixelRatio': 3.0 },
      'userAgent':'Mozilla/5.0 (Linux; Android 5.0; SM-G900P Build/LRX21T) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Mobile Safari/537.36'
    }
  },
  platform_tag: ''
}

],

Current Behavior

With the release of [email protected], chromedriver is rejecting these options.

ERROR: unknown error: cannot parse capability: chromeOptions from unknown error: cannot parse mobileEmulation from unknown error: 'width' must be an integer (Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Linux 4.1.0-0.bpo.2-amd64 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 17 milliseconds Build info: version: '3.5.0', revision: '8def36e068', time: '2017-08-10T23:00:22.093Z' System info: host: 'pandaren.fciis.net', ip: '216.127.34.251', os.name: 'Linux', os.arch: 'amd64', os.version: '4.1.0-0.bpo.2-amd64', java.version: '1.8.0_60' Driver info: driver.version: unknown chrome Error

Steps to Reproduce

Run [email protected] with the specified desired capabilities.

Logs

It is helpful to include any logs that selenium-standalone outputs to help diagnose issues. Take a look at the README for how to enable debug log statements that will help us even more than the standard output logs.

If there are lots of logs, please link to a public gist.

Your Environment

  • Version of selenium-standalone that you are using:
  • Is there another tool calling selenium-standalone on your behalf:
  • System/platform:
  • Other details that might be important:

bstratx avatar Aug 16 '17 16:08 bstratx

The [email protected] release updated the default selenium server version to 3.5.0 (was 3.4.0). Are you still experiencing this problem if you explicitly set the selenium version back down to 3.4.0?

selenium-standalone start --version=3.4.0

Can you share more details about how you are invoking selenium-standalone? What commands you are using, etc. I'm not finding anything about using the capabilities directly with selenium-standalone. Are you using another tool that you are using that calls selenium-standalone on your behalf and does support providing those options?

https://github.com/vvo/selenium-standalone#debug-logs-for-selenium-standalone-process shows how to enable debug logs that would be helpful for us to narrow down the root cause of this issue.

stephenash avatar Aug 17 '17 00:08 stephenash

Hi Stephen,

I'm running selenium standalone through webdriverio's selenium-standalone-service service. https://github.com/webdriverio/wdio-selenium-standalone-service/blob/ master/README.md

I've included a small example selenium-standalone-test.tar with a readme. https://drive.google.com/open?id=0B1tcqC6u74EoNUZDN210Z0syUHc

let me know if you have any more questions.

Bill

On Wed, Aug 16, 2017 at 5:45 PM, Stephen Ash [email protected] wrote:

The [email protected] release updated the default selenium server version to 3.5.0 (was 3.4.0). Are you still experiencing this problem if you explicitly set the selenium version back down to 3.4.0?

selenium-standalone start --version=3.4.0

Can you share more details about how you are invoking selenium-standalone? What commands you are using, etc. I'm not finding anything about using the capabilities directly with selenium-standalone. Are you using another tool that you are using that calls selenium-standalone on your behalf and does support providing those options?

https://github.com/vvo/selenium-standalone#debug- logs-for-selenium-standalone-process shows how to enable debug logs that would be helpful for us to narrow down the root cause of this issue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/vvo/selenium-standalone/issues/299#issuecomment-322937937, or mute the thread https://github.com/notifications/unsubscribe-auth/AUsAH_wdUrYYEAzulVARKP5he7_OzAdEks5sY41EgaJpZM4O5JeU .

-- mobile: 425-444-7429

bstratx avatar Aug 18 '17 20:08 bstratx

@bstratx Thanks for the reproducible example files. That was really helpful.

I was able to see the same problem that you listed, but I don't believe that it is a selenium-standalone issue. Instead, I think it was some change in behavior in selenium v3.5.0 in how those capabilities are parsed. I didn't notice anything in their CHANGELOG [0] as to the change in behavior being expected, so I opened https://github.com/SeleniumHQ/selenium/issues/4511 to help track down the root cause.

That said, you do have a workaround to still use the latest release of selenium-standalone, but define a version of selenium server that works in your environment.

Since you are using webdriverio, you can seleniumArgs and seleniumInstallArgs in your wdio.conf.js file [1] to set the version. Those options map to the same API options that selenium-standalone accepts if called by you directly [2].

    seleniumArgs: {
      version: '3.4.0'
    },

    seleniumInstallArgs: {
      version: '3.4.0'
    },

Adding the above to the wdio.conf.js file that you provided, I was able to execute the sample tests successfully.

I'm going to close this issue, but we can reopen if more details eventually point out an issue in this repo.

[0] https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG [1] https://github.com/webdriverio/wdio-selenium-standalone-service#options [2] https://github.com/vvo/selenium-standalone#application-programming-interface-api

stephenash avatar Aug 19 '17 16:08 stephenash