Selenium: When using Chrome, dev tools annoyingly difficult to open

Created on 7 Jun 2016  路  3Comments  路  Source: SeleniumHQ/selenium

Meta -

OS: Mac OS X 10.11.5

Selenium Version: selenium-webdriver (2.53.0)

Browser: Chrome

Browser Version: 50.0.2661.102 (64-bit)

I am using chrome via Capybara on a Mac. I am using Capybara 2.7.1 on a Rails 4.1.14.2 app

in my spec_helper, I have configured selenium like so:

Capybara.register_driver :chrome do |app|
  Capybara::Selenium::Driver.new(app, :browser => :chrome)
end

Capybara.javascript_driver = :chrome

Expected Behavior -

I want to be able to open Developer Tools while a test is running to inspect Javascript in realtime.

Actual Behavior -

When I choose Dev tools from the menu or Cmd-Option-I from the keyboard, Chrome does not open Dev tools. Sometimes I must do it about 4 times (or 5) times before Chrome actually opens the developer console. developer 馃槩 .

Steps to reproduce -

  1. create a spec with capybara, set a high wait timeout
  2. run your spec
  3. try Cmd-Option-I to open developer tools while the spec is running
  4. developer tools do not open, or it opens intermittently, or you must repeat step 3 about 4 or 5 times before it opens

Most helpful comment

I'm successfully using this config in nightwatch:

...

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        javascriptEnabled: true,
        acceptSslCerts: true,
        chromeOptions: {
          'args': ['incognito', 'disable-extensions', 'auto-open-devtools-for-tabs']
        }
      }
    },
...

All 3 comments

This would require a change in the chromedriver executable itself, which is not maintained by the Selenium project. Feature requests for chromedriver should be logged with the Chromium team. However, note that this behavior in particular is normal and expected.

great thanks for the explanation and link

I'm successfully using this config in nightwatch:

...

    chrome: {
      desiredCapabilities: {
        browserName: 'chrome',
        javascriptEnabled: true,
        acceptSslCerts: true,
        chromeOptions: {
          'args': ['incognito', 'disable-extensions', 'auto-open-devtools-for-tabs']
        }
      }
    },
...
Was this page helpful?
0 / 5 - 0 ratings