# Send Function keys as Inputs

This is a pre-built Action located under the **@Custom Element**. The functionality of this Action in Avo Assure is to perform the specified keyboard action on the object provided in the input. The result is stored in the given dynamic variable for further use during test execution.

{% hint style="info" %}
The **Send Function keys as Inputs** action works only when the **VerifyExists** action is executed in a preceding step.
{% endhint %}

## Syntax

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

| Argument                               | Description                                                                                                               |
| -------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| <p>\<ObjectType></p><p>(Required)</p>  | Provide the object type which you want to send function keys as inputs in the application (e.g., text box).               |
| <p>\<VisibleText></p><p>(Optional)</p> | Provide the visible text associated with the object.                                                                      |
| <p>\<Index></p><p>(Required)</p>       | Provide the position of the element, which helps to identify the value based on the sequence in list . (starting from 0)​ |
| <p>\<FunctionKey></p><p>(Required)</p> | Provide  the keyboard key to be pressed (e.g., Enter, Tab, Esc).                                                          |
| <p>\<Number></p><p>(Optional)</p>      | Provide number of count to perform function key.                                                                          |
| <p>\<abs></p><p>(Optional)</p>         | Provide the absolute XPath of the object you want to identify for this operation.                                         |

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

* If the last argument **abs** is defined, the action executes using absolute identification based on the specified absolute XPath provided in the input.
* To skip an optional input value, use an extra semicolon (;).
  {% endhint %}

**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 1: Sending a Function Key Input to a UI Element**

In this example, we are explaining how to simulate a function key input on a specific object on the application interface.

* **Action**: Send Function Keys as Inputs
* **Input Value**: button;;0;enter;1
  * The first argument (**button**) specifies the object type to be identified.
  * The second argument is left blank to skip an optional value.
  * The third argument (**0**) specifies the index of the object when multiple matching elements are present.
  * The fourth argument (**enter**) specifies the function key that needs to be executed on the object.
  * The fifth argument (**1**) specifies the number of times the function key action should be performed.
* **Output Value**: {Status}
  * The result of the function key operation is stored in the **{Status}** dynamic variable, with the following possible values:
    * **True**: If the function key input is executed successfully on the object.
    * **False**: If the function key input is not executed on the object.
* **Logical Explanation**: The **Send Function Keys as Inputs** action reads the identification details and function key information from the **Input Value** column (**button;;0;enter;1**). The action locates the matching UI element based on the specified object type and index, and then simulates the defined function key input on the object. The execution result of the function key action (True) is stored in the **{Status}** variable.

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

### **Example 2: Sending a Function Key Input to a UI Element Using Optional Parameters**

In this example, we are explaining how to simulate a function key input on a specific object using optional identification parameters.

* **Action**: Send Function Keys as Inputs
* **Input Value**: button;Login;0;enter;1
  * The first argument (**button**) specifies the object type to be identified.
  * The second argument (**Login**) specifies the visible text of the object.
  * The third argument (**0**) specifies the index of the object when multiple matching elements are present.
  * The fourth argument (**enter**) specifies the function key that needs to be executed on the object.
  * The fifth argument (**1**) specifies the number of times the function key action should be performed.
* **Output Value**: {Status}
  * The result of the function key operation is stored in **{Status}** dynamic variable, with the following possible values:
    * **True**: If the function key input is executed successfully on the object.
    * **False**: If the function key input is not executed on the object.
* **Logical Explanation**: The **Send Function Keys as Inputs** action reads the identification details and function key information from the I**nput Value** column (**button;Login;0;enter;1**). The action locates the matching UI element based on the specified object type, visible text, and index, and then simulates the defined function key input on the object. The execution result of the function key action (True) is stored in the **{Status}** variable.

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


---

# Agent Instructions: 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:

```
GET https://docs.avoautomation.com/avo-assure/actions/web/custom-1/send-function-keys-as-inputs.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
