2

I am building a chrome extension that is listening to messages coming from Chrome Dev Tools. We are building a CI system and want to automate the following process:

  1. Open DevTools and go to Elements pane.
  2. Select node (see attached image - chrome1.png)
  3. Select the Accessibility pane (see attached image - chrome2.png)

Are the above interactions possible using Puppeteer? My other option is to use Sikuli (http://www.sikuli.org/), although Puppeteer seems to be the right way to do things

-anurag

anurag
  • 560
  • 6
  • 13

1 Answers1

1

Doesn't appear to work. Here's my attempt:

https://glitch.com/edit/#!/puppeteer-open-console?path=server.js:25:3

Update

This prototype is just a test to see if you can open DevTools by triggering one of its keyboard shortcuts: Control+Shift+J. This doesn't appear to work.

However, one of the Puppeteer owners just told me that you can pass the devtools:true argument to puppeteer.launch() and that will enable you to open DevTools. Haven't tried it myself. He's not sure whether you can automate DevTools actions via Puppeteer. You might be able to get a reference to the DevTools window via browser.targets().

Kayce Basques
  • 23,849
  • 11
  • 86
  • 120
  • 1
    Thanks for the pseudo code, at this point, I am looking into more than just a screenshot. There are few pointers on how to test chrome extension at https://stackoverflow.com/questions/48089670/detect-and-test-chrome-extension-using-puppeteer, however, they don't go in the specifics of mouse interactions or looking for specific elements in the "chrome pane" – anurag May 15 '18 at 16:44
  • The screenshot code is leftover from a different sample. This was just a prototype to see if it's even possible. I'm talking to one of the Puppeteer owners now, check for an update in my answer in a couple minutes for more information. – Kayce Basques May 15 '18 at 17:33