> 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/element/wait-element.md).

# Wait element

This action helps the tool pause and "wait" until a component on the webpage (such as a button, input field) appears before proceeding. If the waiting time elapses without seeing the element, the tool will skip it.

* Effect: Helps the tool run "in sync" with the loading speed of the web. Instead of using a fixed wait command (Delay) that wastes time, this command allows the script to run as quickly as possible and avoids errors of not finding elements due to slow web loading.

#### Configuration parameters:

* Element XPath: The XPath identifier path of the element you need to wait for on the webpage (e.g., `//button[@type="submit"]`).
* Timeout (s): The maximum limit time (in seconds) for the system to wait for the element to appear. If this time elapses and the element has not loaded, the script will automatically move on to the next action in the flow.

#### Real-world example: Wait for the "Post" button to be ready after uploading an image

When you create an automated script to post on social media. After you select an image file and click upload, the website system needs some time to process and render that image on the server. The "Post" button will often be grayed out (Disabled) or not appear until the image has fully loaded.

* Configuration method: Right after the image upload action, you insert the Wait element action.
  * Element XPath: Enter the XPath of the post button, for example: `//span[text()="Đăng bài"]/ancestor::button`.
  * Timeout: Set to `20` (20 seconds).
* Operational logic: The system will continuously check the webpage. If the network is strong and the image loads in 2 seconds, the button will appear, and the script will immediately execute the click command to post (saving 18 seconds of unnecessary waiting). If the network is weak, the system will patiently wait up to 20 seconds to avoid flow errors.

<figure><img src="/files/SbPj2TOuncv3Y246vlDv" 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/element/wait-element.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.
