> 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-guide/javascript/screenshot.md).

# Screenshot

Screenshot is an action that instructs the browser to automatically capture the interface of the current web page. This action is very useful for storing evidence of a completed task, capturing a QR Code, or saving the error interface when a script encounters an issue, making it easier for Debugging.

🎥 Watch more tutorial videos: [Here](https://youtu.be/c3gYFS7IIr4).

#### Configuration parameters:

* Output path: The absolute path to the folder on your computer where you want to store the image after capturing (Example: `D:\GPM_Automate\Screenshots`).
* File name: The name of the image file you want to set (Example: `success_evidence.png`). You can pass dynamic variables such as account IDs or timestamps here to prevent later files from overwriting earlier ones.
* Full page: Check this option if you want the system to capture the entire scrolled web page from top to bottom. If unchecked, the system will only capture exactly the current viewport (the visible display area) that you are currently seeing.
* Output variable: The variable name of GPM Automate used to store the absolute path of the image file just created after a successful capture.

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

When you build a script to automatically post for sale items or provide engagement boosting services. After the system displays the message "Post successful", you want to capture the screen to create a report for the customer:

* Configuration:
  * Output path: `D:\MMO_Project\Report`
  * File name: `account01_done.png`
  * Full page: *Checked* (to capture the entire post content that extends further down).
  * Output variable: `savedImagePath`
* Result: GPM Automate will capture the entire web page, package it into an image file saved in the exact folder you specified, and store that file path in the `$savedImagePath` variable so you can use it for subsequent actions such as sending reports via Telegram/Discord in the following 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-guide/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.
