Upload results
You can upload results to Test Center manually from the Test Center UI or from the command line or automatically from squishide
, Jenkins, or TeamCity.
During the upload, you select or add batch names and labels. For more information about how to pick batch names and labels, see Group results.
Labels starting with a period (.) are hidden across the UI. They are only shown in the Single report view, where you can configure the labels of a report. Test Center uses such labels to control the behavior of 3rd-party integration. The values for these labels have no further analytical value.
One exception to this rule is the .reference.url
label. When set, in the Batch view, a link is added in the column header for this upload (report), pointing to the .reference.url
value. When this label has the format [title](url)
, link title is taken as text for the added link; otherwise, Ref is taken.
Supported result formats
You can upload the following result formats to Test Center:
- Squish XML
When you have no further attachments you can simply upload the
results.xml
generated by Squish. If your result contains screenshots, snapshots or attachments, upload the entire result folder as a zip archive. We recommend to use XML report version 3.4, but older versions are supported as well. - Squish HTML
When you have no further attachments, you can simply upload the
data/results-v1.js
generated by Squish. If your result contains screenshots or snapshots, upload the entire result folder as a zip archive. - Coco CSMES/CSEXE
You can upload a single Coco instrumentation database (*.csmes) per report, together with a number of corresponding execution reports (*.csexe).
- JUnit, CppUnit and other xUnit formats.
- Qt Test xml result format.
If Test Center does not yet support the test result format you are using, you can also use our Result Upload API and implement your own support. We added support for the Robot Framework as part of our Result Reporting API examples.
Manual upload via the Test Center UI
To upload your results manually using the Test Center UI, you will first need to be logged into a user account with upload privileges. Next, hover over the user icon and name in the top right corner, and from the dropdown, choose Result Upload. You should see a page like the one below:
Uploading Results
Select an existing project in the Project dropdown. Alternatively, you can type a new project name and select the Add option to create a new project on result upload. Another way to create a new project is described in Create projects.
Then enter a name for the batch in the Batch field, and select a .zip
, .xml
, .js
, or a single .csmes
file to upload. You can select multiple .csexe
files together with a .csmes
, which Test Center will combine into a single coverage report. Optionally, you can upload arbitrary files as attachments to these results.
In the Labels dropdown, select or add labels to the result, so that the results can be more easily selected from the Reports and Tests sections of the Explore and History views.
Click the Upload button to upload the results or the Reset button to clear all the fields.
Upload via the command line
You can upload results to Test Center on the command line either by using either testcentercmd
or squishrunner
.
Use testcentercmd
To upload results by using the command line, you need the testcentercmd
executable shipped with Test Center.
When invoking testcentercmd
, the following are required:
- An upload token or the email address and password of a Test Center user with upload privileges.
- Project name that identifies tests of the same software, project, or module.
- Path to the test result file or the result directory.
The following are optional:
- URL of the server instance, the default being
http://localhost:8800
. - One or more labels to filter the test results of the same project, the default being
none
. - Name of a batch instead of a generated name
Example usage:
$ testcentercmd --url=http://localhost:8800 --token=MyToken upload Myproject /path/to/results.zip --label=version=1.0.0 --label=OS=Linux --batch=MyBatch
While it is recommended to use an upload token, you can also authenticate with email address and password using the command arguments --user=user@company.com
and --password=password
. If you omit the --password
argument, you are prompted for your account password upon entering this command.
Use the command line argument --json=yes
to get additional upload information like the IMPORT_ID
, which is required for uploading attachments.
To see the full list of testcentercmd
options, enter testcentercmd --help
in a prompt.
Use cURL
In case that testcentercmd
cannot be used due to external factors, it is still possible to use Test Center API to upload results. The API as well as some example using cURL can be found here: documentation .
Use squishrunner
Uploading test results of a squishrunner
test suite execution is a two-step process. First, use the testcenter
report generator for squishrunner
:
squishrunner --reportgen "testcenter,http://localhost:8800/project/Myproject?token=MyToken&label=version%3D1.0.0&label=OS%3Dlinux&batch=MyBatch"
Note: Most URL's will have reserved characters for the command line. It is recommended to use quotes around the --reportgen
value, as seen above, to escape the whole string. Also, verify that the labels, project name, and, batch are URL encoded.
You must also specify either --local
or a running squishserver
instance, as well as a testsuite to be run via --testsuite
.
The label
and batch
are optional. See Creating and Managing Upload Token on how to create a token
. Note that for labels, the equals sign (=) for the label value in the URL must be escaped and becomes %3D
.
After squishrunner
is finished, you should see the IMPORT_ID
that you can use to add labels or upload attachments to the report.
Note: Currently on Linux the number of parallel connections to Test Center is limited to 300. Keep this limit in mind when you run many tests in parallel, and plan on using the reportgen
upload.
Upload attachments via the command line
Once you have obtained an IMPORT_ID
either from the result upload or from the Explore view (on the explore view it is referred to as the report id), you can use the ID to upload additional attachments.
testcentercmd --user=johndoe@mycompany.com add IMPORT_ID --attachment=MyFile1 --attachment=MyFile2
Interactive upload from squishide
In squishide
, select Window > Show View > Test Center.
squishide
Integration
Click the Configure Squish Test Centers button ( ), and then click Add to specify a connection to a Test Center instance. Enter the server URL, email and password, and then click OK.
Once a Test Center Instance is set up within squishide
, the actual result upload can be found in the top right corner of the Test Results view.
squishide
Integration Upload
Upload using the Jenkins Plugin
How to configure the Jenkins Plugin to upload to Test Center is part of the Plugin documentation: Jenkins Plugin Documentation.
Upload from Robot Framework
As part of our Result Upload API examples we also include a listener for the Robot Framework, which can be used to upload results to Test Center from Robot Framework test executions.
The files required for the listener can be found in the testcenter/examples
folder. This is an example for a Robot Framework invocation that uses the listener:
robot --listener TestCenterListener;http://127.0.0.1:8800/upload?project=<project-name>&token=<upload-token>&batch=<batch-name>&os=windows test.robot
Parameters are provided to the listener as a single URL. The following information are required:
- URL of the server instance (
http://127.0.0.1:8800
in the example). - The project name.
- The upload token.
Optional parameters are the batch name, and all other url query arguments, which are interpreted as labels. In the provided example the uploaded results would be labeled with os=windows
.
Upload from TeamCity
Test Center plugin for TeamCity adds functionality to send results to Test Center. Results need to be obtained from an Agent as Artefacts and are sent to Test Center from TeamCity Server. Test Center tab is added to a Build Page containing a link to view results in Test Center. The plugin can be integrated with Squish Runner plugin (version 2.4 and above), where Squish Runner plugin is responsible for executing Squish tests and Test Center plugin is responsible for sending them to Test Center.
Installation
The plugin is available from: download.froglogic.com/resources/testcenter-teamcity-latest.zip. To install the Test Center plugin, shut down TeamCity server and copy the zip archive with the plugin to TeamCity Data Directory/plugins directory.
When you start the TeamCity server, the plugin files are unpacked and processed automatically. To check where the TeamCity Data Directory is located, go to Administration > Global Settings. To verify that the plugin is installed, go to Administration > Plugins List. Test Center plugin shall be listed in the External Plugins list.
Configuration
The first step is to provide information to TeamCity about Test Center installation.
- Go to Administration > Test Center.
- Provide Test Center base URL and Upload Token.
- Click the Test Connection button to verify that the data you entered is correct.
The next step is to configure Build Configuration to send results to Test Center:
- Edit Build Configuration Settings.
- Go to Build Features.
- Click Add build feature.
- Choose Test Center Build Feature.
- Provide Test Center Project name, Batch name, Labels, and Result directory. If Squish results are being sent and Squish plugin is used to run tests, enter xml3 in Result directory.
Exploring results
After TeamCity build is finished, Test Center tab on a Build Page contains a link to explore results in Test Center.
© 2024 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners.