Upload a File
This is a pre-built Action located under the @Custom Element. The functionality of this Action in Avo Assure is to upload a file to the object specified in the input by providing the file path from the local system. The result is stored in the given dynamic variable for further use during test execution.
The Upload a File action works only when the VerifyExists action is executed in a preceding step.
Syntax
Input Value: <ObjectType>;<VisibleText(Optional)>;<Index>;<file path>;<file name><wait(in seconds)>;<abs(Optional)>
<ObjectType> (Required)
Provide the object type which you want to perform the get image similarity percentage operation. (e.g., Image)
<VisibleText> (Optional)
Provide the visible text associated with the object.
<Index> (Required)
Provide the position of the object you want to identify based on its sequence in the application. Note: Index start from 0.
<file path> (Required)
Provide the path of the file which you want to upload.
<file name> (Required)
Provide the name of the file.
<wait (in seconds)> (Optional)
Provide the wait time (in seconds) you want before performing the action.
<abs> (Optional)
Provide the absolute XPath of the object you want to identify for this operation.
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 (;).
If the wait (in second) input is specified, the action is performed after the specified wait duration.
Output Value: <Dynamic Variable>(Optional);<Dynamic Variable>(Optional)
<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)
Both dynamic variable stores the status as True or False.
Example 1: Uploading a File to an Input Field
In this example, we are explaining how to upload a specified file to a selected input field in the application interface.
Action: Upload a File
Input Value: input;;0;C:\Documents\Reports;Report_Q2.pdf;3
The first argument (input) 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 input field when multiple matching elements are present.
The fourth argument (C:\Documents\Reports) specifies the directory path where the file is located.
The fifth argument (Report_Q2.pdf) specifies the name of the file to be uploaded.
The sixth argument (3) specifies the wait time (in seconds) before performing the upload operation.
Output Value: {Status}
The result of the file upload operation is stored in the {Status} dynamic variable.
True: If the file is uploaded successfully.
False: If the file is not uploaded.
Logical Explanation: The Upload a File action reads the identification details, file path, file name, and wait time from the Input Value column (input;;0;C:\Documents\Reports;Report_Q2.pdf;3). The action locates the matching input field based on the specified object type and index, waits for the defined duration, and uploads the specified file to the input field. The execution result of the upload operation (True) is stored in the {Status} variable.

Example 2: Uploading a File using Optional Parameters
In this example, we are explaining how to upload a specified file to a selected input field in the application interface using optional identification parameters.
Action: Upload a File
Input Value: input;upload;0;C:\Documents\Reports;Report_Q2.pdf;3
The first argument (input) specifies the object type to be identified.
The second argument (upload) specifies the visible text or identifier of the input field.
The third argument (0) specifies the index of the input field when multiple matching elements are present.
The fourth argument (C:\Documents\Reports) specifies the directory path where the file is located.
The fifth argument (Report_Q2.pdf) specifies the name of the file to be uploaded.
The sixth argument (3) specifies the wait time (in seconds) before performing the upload operation.
Output Value: {Status}
The result of the file upload operation is stored in the {Status} dynamic variable.
True: If the file is uploaded successfully.
False: If the file is not uploaded.
Logical Explanation: The Upload a File action reads the identification details, file path, file name, and wait time from the Input Value column (input;upload;0;C:\Documents\Reports;Report_Q2.pdf;3). The action locates the matching input field based on the specified object type, visible text, and index, waits for the defined duration, and uploads the specified file. The execution result of the upload operation (True) is stored in the {Status} variable.

Last updated