File testing
What is file testing?
Modern web applications often offer more functionality than the equivalent native applications. They frequently generate files that are downloaded by the user or emailed to them. A classic example is an airline booking site. Once you have bought your ticket you can check in online and download your boarding pass as a PDF. But how can you test whether this flow is working correctly? This is when you turn to file testing.
Why is file testing so useful?
If your application relies on file downloads, it’s important to test if the download is successful. An airline booking site is useless if you can’t get your boarding pass or if the pass is inaccurate. However, testing whether these downloads are correct is nigh impossible with traditional automation frameworks. At best, you can check whether a file of approximately the right size was created. You can only validate the content of the file manually.
How can Functionize help?
Much more than simple web UI testing
Functionize allows anyone to create smart AI-powered tests. The File Viewer is a powerful feature that is designed to streamline and simplify file testing. It works by uploading the file into the system. This is then parsed by the AI system to identify the key content and elements in the file. These can then be validated against the expected content to check if everything is working correctly.
Testing file downloads
File testing is extremely simple with the File Viewer.
- Import an example file of the type you want to test.
- Locate the elements to verify in the file, just as if it was a website.
- Add the desired verification, for instance, does the booking number match the one in the system.
- When you run your tests, the system will import any generated file and test it against what is expected.
Not just visual verification
Most approaches to file testing simply use visual verification. They just check if the file looks similar to what was expected. By contrast, Functionize validates the actual containing elements, too. This is particularly important for many use cases such as ticketing or tax returns.
Supported formats
Functionize supports file testing for the most common types of document:
- PDFs and raw text files
- Spreadsheets, including .csv and Excel files
- HTML files