File Handling (Upload/Download)
Upload, Download, and Validate Files in ContextQA Test Automation
ContextQA makes working with files in test automation simple and reliable. In this tutorial, you’ll walk through how to upload a file, then download and validate it using the platform’s built-in AI features, following the exact steps shown in the demonstration.
Introduction
With ContextQA, you can automate complex file handling scenarios—like uploading files and confirming their content after download—without manual coding. This guide shows you each step clearly, just as demonstrated in the tutorial video.
Click the Test Development section and go to Uploads.
Choose a file from your local system to upload. Already uploaded the file? Click the copy icon next to it to copy its file path.
Hit the plus icon to initiate an AI-driven upload. You’ll see options for uploading via NLP templates and more.
When prompted by the assistant, enter your target website URL in the field.
In the prompt box, write what you want to automate in plain English—such as: "Verify that the user is on the upload file page. Upload the file in the choose file input field using the path."
Paste the file path you copied earlier, removing any unnecessary extras.
Click the Generate Test Case button to let the AI build your test.
Once generated and run, you’ll see from logs and screenshots that your file has been uploaded successfully.
Download and Validate Files
Set up a test case for file downloading and validation (already prepared in this demo).
Add an NLP template for downloading by clicking Labels. Pass in the download button locators and designate a variable for later verification—this template handles file downloading and storage.
To validate file content, add a document task. Here, enter a query specifying what to verify inside the file and include your variable name if you want to check additional details.
For the file path parameter, input the variable you set in the previous step using dollar sign and curly braces (for example, `${fileVariable}`), matching the download NLP template setup.
Run the test case. The download and validation steps will execute: the download occurs by clicking the designated button, and the AI document task verifies the file content.
When the test is complete, the interface confirms success; the logs and screenshots show the file was both downloaded and validated correctly.
Conclusion
ContextQA streamlines handling file uploads, downloads, and validations, letting you automate end-to-end scenarios confidently and efficiently. Use these steps whenever you need robust file verification in your test suites.
Last updated