> For the complete documentation index, see [llms.txt](https://docs.gpmautomate.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gpmautomate.com/automate-en/action-guides/javascript/screenshot.md).

# Screenshot

Screenshot is the action of instructing the browser to automatically capture the interface of the current webpage. This action is very useful for storing evidence of task completion, capturing QR Codes, or saving the error interface when the script encounters issues for easier debugging.

#### Configuration parameters:

* Output path: The absolute path to the folder on your computer where you want to store the image after capturing (e.g., `D:\GPM_Automate\Screenshots`).
* File name: The name of the image file you want to set (e.g., `success_evidence.png`). You can pass dynamic variables such as account numbers or timestamps here to avoid the new file overwriting the previous one.
* Full page: Check this option if you want the system to capture the entire webpage from top to bottom. If unchecked, the system will only capture the current viewport (the area currently visible).
* Output variable: The variable name of GPM Automate used to store the absolute path of the image file created after a successful capture.

#### Practical example: Automatically save confirmation image after successful post

When you create a script to automatically post sales or increase interaction services. After the system displays the message "Post successful," you want to take a screenshot for reporting to the client:

* Configuration:
  * Output path: `D:\MMO_Project\Report`
  * File name: `account01_done.png`
  * Full page: *Checked* (to capture the entire content of the post that extends below).
  * Output variable: `savedImagePath`
* Result: GPM Automate will capture the entire webpage, package it into an image file saved in the specified folder, and store the file path in the variable `$savedImagePath` for you to use in subsequent actions to send reports via Telegram/Discord in later steps.

<figure><img src="/files/X25oCn3xHv9GwdH3GT2j" alt=""><figcaption></figcaption></figure>


---

# 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.gpmautomate.com/automate-en/action-guides/javascript/screenshot.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.
