Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome Developer Tools closes instantly when attempting to debug WebDriver E2E test

I usually debug my Selenium tests in Chrome's dev tools panel. However, after upgrading my OS (Ubuntu Linux), my E2E tests broke completely: Chrome didn't open the first page, but sat idle showing only a blank page. Eventually I upgraded ChromeDriver, and now the tests work again. But with this new Chrome version (after the OS upgrade) and with this new ChromeDriver, there's a weird problem with the dev tools window:

Whenever I click CTRL + SHIFT + I to open the dev tools window, or click Tools -> Developer Tools in Chrome's menu, the dev tools window flashes open, but then closes instantly. It looks blank and empty, the 1/10 seconds it's visible. This has really never happened before.

When I manually open another tab in [the Chrome instance that's being driven by WebDriver], and navigate to e.g. http://www.google.se/, then, when I open the dev tools window in that tab, it usually stays open (but not always). — It's mainly [the dev tools window for the browser tab that is being controlled by the Chrome Driver] that closes instantly.

However if I hold town CTRL+SHIFT+I for a while, this genereates many many "clicks", and then the dev tools suddenly stays open, sometimes. But after 10-20 seconds it suddenly closes again.

Why is Chrome doing this? How can I have it stop?

Chrome Version 29.0.1547.57
Chrome Driver versions 2.0, 2.1 and 2.2 tested (and problem present).
Selenium 2.35.0, and version 2.25.0 (I think it was) also didn't work.

like image 624
KajMagnus Avatar asked Aug 24 '13 16:08

KajMagnus


People also ask

How do I fix Chrome developer tools?

# Open the Issues tabOpen DevTools. Click the Go to Issues button in the yellow warning bar. Alternatively, select Issues from the More tools menu. Once you're on the Issues tab, click the Reload page button if necessary.

How can I stop chrome from going into debug mode?

Go to the "Sources" tab. At the top right hand side, toggle the button that looks like the pause symbol surrounded by a hexagon (button on the far right) until the color of the circle turns black to turn it off. If the pause symbol isn't blue it may be that you've accidentally marked a line for debugging inspection.

What are 3 ways to open developer tools in Google Chrome?

To open the developer console in Google Chrome, open the Chrome Menu in the upper-right-hand corner of the browser window and select More Tools > Developer Tools. You can also use Option + ⌘ + J (on macOS), or Shift + CTRL + J (on Windows/Linux).


1 Answers

Chrome isn't doing this; ChromeDriver 2 is. ChromeDriver 2 and the DevTools windows both compete for the same automation channel, and ChromeDriver automatically closes the DevTools window in order for it to work.

See https://sites.google.com/a/chromium.org/chromedriver/help/devtools-window-keeps-closing for more info

Also see the related issue: https://code.google.com/p/chromedriver/issues/detail?id=483

like image 55
Ken Kania Avatar answered Oct 19 '22 09:10

Ken Kania