Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use DesiredCapabilities rather than capabilties for Chrome #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tomredsky
Copy link

Attempting to use the latest version, v0.102 of Webdriver::Tiny gives the error

invalid argument: unrecognized capability: chromeOption

The error comes from ChromeDriver. I am using v83. with Chromium v83.

[1592570630.554][INFO]: [3aeaec81370b4e7cb99f685bc4b748e4] COMMAND InitSession {
   "capabilities": {
      "alwaysMatch": {
         "chromeOptions": {
            "args": [ "disable-web-security", "ignore-certificate-errors" ],
            "binary": "C:\\Users\\Default\\Downloads\\chromium-83-0-4103\\chrome-win\\chrome.exe"
         }
      }
   }
}
[1592570630.568][INFO]: [3aeaec81370b4e7cb99f685bc4b748e4] RESPONSE InitSession ERROR invalid argument: unrecognized cap
ability: chromeOptions

`DesiredCapabilities` works where `capabilites` does not. Tested on
chromium/chromedriver v83 and WebDriver::Tiny v0.102.
@colinnewell
Copy link
Contributor

I'm not convinced your doc fix works in the way you think it does. I suspect what's happening is that you're effectively not passing any capability options with your tweak. That means that we're not sending over stuff that doesn't work preventing the error, but I don't think that we are sending over your options in this case.

I did start playing about with getting Chrome stuff working with this library in a branch, but I stalled on fixing it fully. I should take a look at what is necessary to get that going again.

@colinnewell
Copy link
Contributor

See #5 for my attempt at fixing it a while ago. It was created a couple of years ago, so things may have moved on since, and I can't quite remember why I didn't get around to finishing it.

@tomhukins
Copy link
Contributor

Hi, Colin and Dermot.

I've managed to get recent versions Chromedriver to do what I want with capabilities => { "goog:chromeOptions" => .. }. For example, to run Chrome in headless mode, I run something like WebDriver::Tiny->new( port => 4444, capabilities => { "goog:chromeOptions" => { args => [ 'headless'] } } ).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants