> For the complete documentation index, see [llms.txt](https://docs.avoautomation.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.avoautomation.com/avo-assure/actions/custom/simulate-press-action.md).

# Simulate Press Action

This pre-built action available under the **@Custom** element type. The action performs a Press operation on the element specified in the Input Value and stores the result in a dynamic variable as **True** or **False**.&#x20;

## **Syntax**

**Input Value:** `<ObjectType>;<VisibleText(optional)>;<Index>;<abs(optional)>`

{% hint style="info" %}
**Note:**

* Ensure that the specified element exists and is accessible before executing the Action.
* The element must be visible and loaded completely for successful execution.
  {% endhint %}

| Argument                             | Description                                                                                                                 |
| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------- |
| <p>\<ObjectType> <br>(Required)</p>  | Specify the type of custom element on which the Press operation is to be performed.                                         |
| <p>\<VisibleText><br>(Optional) </p> | Specify the visible text of the element, used to identify the target element when multiple elements of the same type exist. |
| <p>\<Index><br>(Required)</p>        | Specify the index of the element to identify the target element when multiple matching elements exist.                      |
| <p>\<abs><br>(Optional)</p>          | Specify whether the index should be treated as an absolute position of the element.                                         |

**Output Value:** `<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)`

| **Argument**                                                | **Description**                                                   |
| ----------------------------------------------------------- | ----------------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | Both dynamic variable stores the status as **True** or **False**. |

### **Example: Simulating Press Action on a Custom Element**

* **Action:** Simulate Press Action&#x20;
* **Input Value:** Button;Login;0
  * The first argument **Button** specifies the object type of the custom element.
  * The second argument **Login** specifies the visible text on the element.
  * The third argument **0** specifies the index of the element.
* **Output Value:** {Status}
  * The result of the Simulate Press Action is stored in the {Status} dynamic variable, with the following possible values:
    * **True:** The Press operation is successfully performed on the specified element.
    * **False:** The Action fails due to an invalid object type, unmatched visible text, incorrect index, or the element being inaccessible.
* **Logical Explanation**: The **Simulate Press Action** reads the object type, visible text, index, and absolute flag (if provided) from the **Input Value** field. During execution, Avo Assure identifies the specified custom element and performs the Press operation on it. The Action then stores the execution status in the **{Status}** dynamic variable.

#### Knowledge Bites

| Scenario                                     | Input Value     | Result                                                                       |
| -------------------------------------------- | --------------- | ---------------------------------------------------------------------------- |
| Press using object type and index only       | Button;;1       | Performs a Press operation on the first matching Button element.             |
| Press using visible text to narrow selection | Icon;Settings;1 | Performs a Press operation on the Icon element with visible text "Settings". |
| Press using absolute index                   | Link;;2;abs     | Performs a Press operation on the Link element at absolute index 2.          |


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.avoautomation.com/avo-assure/actions/custom/simulate-press-action.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
