How can I use the Chrome developer tools to inspect my page while it's running from Protractor? When I try to open the devtools, I get this error from protractor:
UnknownError: disconnected: not connected to DevTools
(Session info: chrome=35.0.1916.114)
(Driver info: chromedriver=2.10.267518,platform=Linux 3.5.0-49-generic x86_64)
You can't because webdriver uses the developer tools to communicate with chrome. If the dev tools window is open then your can't execute any protractor code.
https://sites.google.com/a/chromium.org/chromedriver/help/devtools-window-keeps-closing
I would advice you to duplicate the tab or pause your test either with
browser.sleep(ms)
orbrowser.debugger()
There is a new
pause
function that can be used to open the dev tools and e.g. taking a heap snapshot. It pauses the test execution until you continue the execution from the command window.More details here:
To use it, simply add the following to your test code:
Once you're ready to continue the test, type in
d
followed byEnter
in the paused command window/terminal.