Help us understand the problem. What is going on with this article?

Selenium grid で chrome node に option を設定する

More than 1 year has passed since last update.

結論

goog:chromeOptions に設定する

  caps = Selenium::WebDriver::Remote::Capabilities.chrome
  caps['goog:chromeOptions'] = { args: ['--incognito'] }

  Capybara::Selenium::Driver.new(app,
                                 browser: :remote,
                                 desired_capabilities: caps,
                                 url: 'http://localhost:4444/wd/hub')

Selenium Grid での問題

ここの docker を使って、selenium-hub, node の構成で selenium を実行する時の話。ここにあるように、chromeOptions に 起動オプションを設定しても、node に反映されない

  caps = Selenium::WebDriver::Remote::Capabilities.chrome
  caps['chromeOptions'] = { args: ['--incognito'] }

  Capybara::Selenium::Driver.new(app,
                                 browser: :remote,
                                 desired_capabilities: caps,
                                 url: 'http://localhost:4444/wd/hub')

以下の issue にあるように chromeOptions ではなくて goog:chromeOptions に設定すると有効になる。
https://github.com/elgalu/docker-selenium/issues/201#issuecomment-355138247

chromedriver の仕様変更の影響らしい
https://github.com/SeleniumHQ/docker-selenium/issues/674

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away