# Save File

This is a pre-built Action located under the **@Browser Element**. The functionality of this Action in Avo Assure is to save a file opened in a new tab with the specified name, allowing the file to be stored in a specific folder during test execution. The result is stored in a dynamic variable for further use during test execution.

## Syntax

**Input Value**: `<FilePath>;<FileName.extn>;<Wait (in Seconds)>(Optional)`&#x20;

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>&#x3C;FilePath><br>(Required)</td><td>Provide the location to save the file.</td><td></td></tr><tr><td>&#x3C;FileName.extn><br>(Required)</td><td>Provide the name of the file along with its extension (for example, .pdf, .txt).</td><td></td></tr><tr><td>&#x3C;Wait (in Seconds)><br>(Optional)</td><td>Provide the time in seconds to wait before performing the action.</td><td></td></tr></tbody></table>

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

<table><thead><tr><th>Argument</th><th>Description</th><th data-hidden></th></tr></thead><tbody><tr><td>&#x3C;Dynamic Variable>(Optional);&#x3C;Dynamic Variable>(Optional)</td><td>Both dynamic variable stores the status as <strong>True</strong> or <strong>False</strong>.</td><td></td></tr></tbody></table>

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

* This action is applicable only for Web applications.
* If a file such as .txt, .pdf, or .xml opens in a new browser tab, Avo Assure allows saving it locally.
* There is no need to specify the file extension in the input. ICE automatically saves the file with its original extension.
* If a wait time (in seconds) is provided, ICE waits for the specified duration before launching the file explorer.
  {% endhint %}

### Example: Saving a File Opened in the Browser

In this example, we explain how to save a file opened in the browser to a specified local path using the **Save File** action.

* **Action**: Save File
* **Input Value**: C:\Users\Downloads\dictionary.pdf;2
  * The file path (**C:\Users\Downloads\dictionary.pdf**) specifies the location on the local system where the file should be saved.
  * The optional wait time (**2**) represents the delay (in seconds) before initiating the save operation.
* **Output Value**: {Status}
  * The result of save file operation is stored in the **{Status}** dynamic variable, which returns one of the following values:
    * **True**: If the file is saved successfully.
    * **False**: If the file is not saved successfully.
* **Logical Explanation**: The **Save File** action takes the value from the **Input Value** column (**C:\Users\Downloads\dictionary.pdf;2**) and saves the file currently open in the browser to the specified path. The optional wait time allows for a short delay before performing the save. After execution, the result of this operation is stored in the **{Status}** variable as true.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FyUafH13wkLmoBdhtITtk%2Fimage.png?alt=media&#x26;token=45033a17-e231-4f18-a55f-4cdd98522bfb" alt=""><figcaption></figcaption></figure>
