Write to File
This pre-built Action located under the @Generic Element Name instructs Avo Assure Client to write given content in the file whose file path is provided in Input Value and save the result as ‘true’ or ‘false’ in the given output variable.
In the Output variable, “True” will be returned if given content is written in file, else “False”.
Syntax
Input:
For Text file: <file path>; <content to write>;<Newline>
This syntax is for .txt file where user need to provide file path, content to write and newline if required
XML/JSON File: <file path>;<content to write>
This syntax is for .json or .xml file where user need to provide file path and content in Input Value to write content in desired file
For Excel file: <file path>;<Sheetname>(Optional);<content to write>;<Newline>
This syntax is for .xls file where user needs to provide file path, content to write and newline if required.
Output:
<Dynamic Variable>;<Dynamic Variable>(Optional)

Usecase/Example

Scenario: Logging Test Results to a File
When you are testing a system that generates reports. After executing tests, you want to log the results into a designated output file for review and analysis.
Input
Output File: testResults.txt
Content to Write: “Test Case 1: Passed”
Using the Action:
In the automation script, the "Write to File" Action is used to append the test result to the output file.
Expected Result
By using the "Write to File" Action in this testing scenario, Avo Assure ensures that test results are logged accurately, facilitating easy tracking and reporting of test outcomes.
Output
This Action will write the content in the provided file store them in the {result} output variable, which can be utilized for display or other purposes.
Last updated
Was this helpful?