How can I use Puppeteer to interact with a Chrome extension in my tests? or Best way to interact with

18 Replies, 1597 Views

Oh man, this is a pain. I got it working by injecting scripts into the extension’s popup.

You gotta first find the extension’s ID (check chrome://extensions), then:
```javascript
const extUrl = `chrome-extension://${extensionId}/popup.html`;
const page = await browser.newPage();
await page.goto(extUrl);
```
From there, you can puppeteer interact with extension elements like normal. Not perfect, but it works!

Messages In This Thread



Users browsing this thread: 1 Guest(s)