# Upload a File

This is pre-built Action located under the **@Custom Element.** The functionality of this action in Avo Assure to upload a file on the object specified in the input by providing the file path from the local system, and save the result in dynamic variable.

### **Syntax:** &#x20;

**Input Value:** `<Object Type >;<Visible Text(Optional)>;<index>;<file path>;< file name><wait(in second)>;<abs (optional)>`&#x20;

| Argument                                     | Description                                                                                                    |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| <p>\<ObjectType><br>(Required)</p>           | Specify the type of object (e.g., Button)                                                                      |
| <p>\<VisibleText><br>(Optional)</p>          | Enter the visible text on the object                                                                           |
| <p>\<Index><br>(Required)</p>                | Provide the index of the object inside the page                                                                |
| <p>\<FilePath><br>(Required)</p>             | Path to the folder containing the file to upload                                                               |
| <p>\<FileName><br>(Required)</p>             | Name of the file to be uploaded (e.g., Report\_Q2.pdf)                                                         |
| <p>\<WaitTime(in seconds)><br>(Optional)</p> | Wait time before action execution                                                                              |
| <p>\<abs><br>(Optional)</p>                  | If the **abs** is provided, the action is performed with absolute identification using the **absolute X path** |

{% hint style="warning" %}
**Note:**&#x20;

* *If the ‘wait (in seconds)’ input is specified, then the action will be performed after the duration of the specified wait time.*
* *If for last argument abs is defined, then the Action must be executed with absolute preformation with the specified visible text in the input.*&#x20;
* *To skip an optional input value, use an extra semicolon (;).*
  {% endhint %}

**Output Value**

| Argument                                                    | Description                                                                          |
| ----------------------------------------------------------- | ------------------------------------------------------------------------------------ |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | This dynamic variable stores the result of the verification as **True** or **False** |

**Example**&#x20;

**Uploads a specified file to the selected input field in the application interface**

The **Upload a File** action takes the value from the Input Value column (e.g., **input;;0;C:\Documents\Reports;Report\_Q2.pdf;3**) and uploads the given file after the specified wait time. The result of the file upload operation is stored in the **{Upload}** variable, with the following possible values:

* **True** – if the file is uploaded successfully.
* **False** – if the file upload fails.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FVf5giJBO7aMBXlVkhawG%2Fimage.png?alt=media&#x26;token=84678995-3ebc-457b-82c0-cdbed7bb6398" alt=""><figcaption></figcaption></figure>
