> 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/mouse/mouse-click.md).

# Mouse click

Mouse click is the action of controlling the mouse pointer to perform a click command at a specific location on the screen. To optimize for different interface interaction scenarios, GPM Automate provides you with 3 flexible setup options:

#### 3 types of mouse click options compatible with all interfaces

**1. Click based on XPath (Default for Web interface)**

* How it works: You enter the XPath of the element on the webpage (e.g., `//button[@id="submit"]`). The system will automatically search for this HTML tag, calculate its position in the browser, and move the mouse to click accurately.
* Application: Used for standard webpage structures, fixed buttons with clear source code tags.

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

**2. Click based on the current position of the mouse pointer**

* How it works: The system does not move the mouse anywhere but will perform the click command right at the point where the mouse pointer is stationary from the previous action (such as after the Mouse move or Random scroll command).
* Application: Used when you have a complex series of mouse movement actions beforehand and just need to issue a click command to activate.

**3. Click based on coordinates (Perfectly combined with Image search)**

* How it works: You directly enter the pixel position along the horizontal `X` and vertical `Y` axes on the screen for the mouse to jump and click.
* Optimal combination: This type of click is often combined with the Image search action. When *Image search* finds the target image, it will return a combined coordinate variable (for example, the default variable name is `pos`) as a text string containing both the X and Y axes separated by a comma: `900,800`.
* Configuration method: In the coordinate input box of the *Mouse click* action, you just need to directly pass the combined variable `$pos`. GPM Automate's intelligent system will automatically parse this syntax `900,800` to move the mouse to coordinates x=900, y=800 to click directly on the target.
* Application: Used to click on elements within a Canvas (game), buttons hidden deep within secure Iframes, or interact with components that do not have a fixed XPath tag.

<figure><img src="/files/tb3unShiiJk3jmhlhqaP" 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/mouse/mouse-click.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.
