> For the complete documentation index, see [llms.txt](https://docs.puppetry.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.puppetry.app/testing-techniques/testing-chrome-extensions.md).

# Testing Chrome Extensions

An average Chrome Extension is HTML5 application, therefore we can test it with Puppetry. The only difference here is in way we obtain the page context. The following walkthrough explains how it can be done:

1\) Open Chrome browser.

2\) Navigate to `chrome://extensions`

3\) Turn on the **Developer mode** switcher.

![Loading the Chrome extension](/files/-LtyfDspPJ00oc68b9-8)

4\) Load the unpacked version of your extension. You can create a demo one with [extensionizr.com](https://extensionizr.com/) service.

![Saving Chrome extension ID](/files/-LtyfHvtmHBGhELBTGN8)

5\) Write down the extension ID (e.g. `eclajhagmjdnniapeipnfejgmplgehme`) from appeared extension card.&#x20;

6\) Launch Puppetry and create an empty test case

7\) Check the extension `manifest.json` file for `default_popup` value (e.g. `src/page_action/page_action.html`)

8\) Add command `page.goto` with URL like **chrome-extension://EXTENSION\_ID/EXTENSION\_RELATIVE\_URL** (e.g. `chrome-extension://eclajhagmjdnniapeipnfejgmplgehme/src/page_action/page_action.html`)

![Navigating to the Chrome extension main page](/files/-LtygTdg4Oo8N6qBpw9c)

9\) Add command `page.screenshot` to take a screenshot when the extension HTML is loaded

10\) Open **Run Tests** dialog (press **F6** or **Run** in the main menu)

11\) Switch to **Browser options** and set the Chrome extension folder location (with **Browse...** button)

![Feeding Chrome extension sources to Puppetry](/files/-Ltyh1TJe1EsPh9jYEpg)

12\) Click on **Run** button

13\) Observe the report

![Chrome extension test results](/files/-LtyhBLeAwDyfQtpZn_v)

\
So we have got the screenshot with Chrome extension page view. Thus we can develop a real test case with commands and assertions pointed at the extension page context.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.puppetry.app/testing-techniques/testing-chrome-extensions.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
