Output Settings
How to Tell CAT What Output I Need?
On this page
Your project file is the main input for CAT, you specify what you want there. Requests for various outputs is no exception.
There are two ways, how to specify what outputs you need:
- simple one, if you don’t need complete control
- detailed one (but don’t be scared, it’s two or three lines)
Simple Specification
It really is simple. Let’s say you want a MS Excel file with the results. Put this to your project file:
Output: xlsx
You may need more outputs, not only MS Excel. As simple as that:
Output: trx, xlsx, yaml, json
CAT will notice you want the MS Excel file (and/or outputs in other formats) and after it runs all the tests, it will create the necesarry file(s).
Here is an example, screenshot is from Visual Studio Code (it is a real-life project):
You can see CAT created the output files in TestResults
directory next to the project file. Also notice the timestamp in the file name.
Detail Control
Your needs might be different. Often it is necessary to put the file elsewhere, give it different name etc. Or you may want to have one file only and always rewrite it with fresh results.
Easy to achive that, again couple of lines:
Output:
- File: "LatestTestResults.xlsx"
Format: xlsx
You can specify more types of output:
Output:
- File: "LatestTestResults.xlsx"
Format: xlsx
- File: "Z:\\TestResults\\SmokeTests-{timestamp}.json"
Format: json
Relative paths are resolved against the same directory where is your project file.
Notice the {timestamp}
in the example - it is automatically replaced with the date/time when the output is generated (that means after the execution of all your tests finished). UTC format is always used, spaces and colons are replaced with dashes. So something like this is added to the file name: 2023-04-27T12-14-12.3774934
.
If you need even more control, you will need custom post-processing step. But let us know about the scenario, the idea of CAT is to help you get job done as quickly as possible, we’ll consider how to help with that in future versions of CAT.
For backward compatibility, also this format is supported:
Output:
- Format: xlsx
Path: "LatestTestResults.xlsx"
It may disappear in future major version of CAT.
Output to Database
You can store results of tests in a relational database. So far, only SQL Server is supported, but ORACLE and Postgres support will come soon.
You specify name of an existing data source as a target:
Output:
- Database: MyDWH # this must be a name of an existing data source you defined
Table: dbo.TestResults # configurable
See details in: