The Image Tester is a semi-codeless stand-alone solution with which you can perform visual validations for PDF files.
With Image Tester, the visual validation process is divided into two sections:
1. Organize the PDF files (user's responsibility).
It is necessary to organize the PDF files in the following hierarchy:
Batch -> Test -> Step
Batch:
Batch is used to gathering multiple tests together. This will be a folder containing the tests which you want to gather under the same batch, and the batch name will be the name of that folder.
Test:
This will be a folder containing the PDF files which you want to validate, each file is a test, and the test name will be the name of that file.
Steps/Pages:
These are the pages of the PDF file, and the steps names will be the index of the pages.
2. Visual validating the PDF files with Image Tester.
After creating the folders hierarchy, download the Image Tester tool (attached).
Next, specify which tests/steps you wish to visually validate:
- Open your CMD/Terminal and go to the ImageTester.jar location
- To run a test, execute the following command:
Java -jar ImageTester.jar -k <YOUR_API_KEY> -f <BATCH_FOLDER_FULL_PATH>
- For optional parameters see the following list or execute Java -jar ImageTester.jar
Optional Parameters:
- -a [app-name] - Set the name of the application under test (Default: ImageTester)
- -p [http://proxy{;user;pass}] - Set proxy and optional username and password
- -s [server] - Set Applitools server URL
- -ml [match-level] - Set the comparison level: Strict/Content/Layout (Default: Strict)
- -br [branch] - Set the branch
- -pb [parent-branch] - Set the parent branch
- -bn [baseline-env-name] - Set custom baseline environment name
- -vs [WidthxHeight] - Set the viewport size identifier
- -lf [log-file] - Set log fine name to enable logging
- -os [OS-name] - Set custom os name
- -ap [browser-name] - Set custom browser name or host application name
- -as - Set automatic save on failure
- -di [dpi] - Set the quality of the conversion on PDF files
- -sp [pages] - Comma separated page numbers to include in PDF testing (e.g. 1,2,5,7)
- -pp [password] - The password if the PDF file is protected
- -pn - Preserve original test names when specifying pages
Note: Same as the fully coded solution, the first run will create your baseline, and from the second run, it will check for mismatches.
The Image Tester can also be used for validation of image files. Click HERE to learn how.