After the build is finished, you can view the results of your TestComplete tests in Jenkins.
You can view the results from the build page. If generation of JUnit-style reports or JUnit reports was enabled, you can also view the results in the way you find suitable for this type of reports. For example, on the Test Results page of your build.
You can configure your TestComplete Test step to export its test results in the JUnit report format. Such reports are similar to reports generated by JUnit tests.
|Note:||This format differs from the JUnit-style report described below.|
To generate a report:
In your TestComplete Test build step, specify the
/ExportSummarycommand-line argument in the Additional command-line arguments text box and specify the path to the folder where you want to save the generated test results:
If you use a pipeline, specify the commandLineArguments parameter:testcompletetest launchType: 'lcProject', project: 'MyProj', suite: 'Projects\\JenkinsTests.pjs',
When you run your build, the TestComplete Test step will generate a report and save it to the specified location.
Unlike Junit-style reports described below, the TestComplete Test step will not publish the report automatically, you will have to do this manually. The same way, you do this with ordinary JUnit reports. For example, you can use the JUnit plugin to publish your report.
JUnit-Style Test Reports
If generating JUnit-style reports is enabled for your tests (see the description of the Generate JUnit-style report option of the TestComplete Test step or the description of the
publishJUnitReports parameter of the TestComplete Test step for Pipeline scripts), the TestComplete Jenkins plugin creates reports similar to those generated by JUnit tests. You can view them on the following pages:
Project's Status Page
On this page, Jenkins displays a graph with test results for the builds that created JUnit-style reports. This graph shows the ratio of failed tests to the total number of tests. The graph counts only the builds for which JUnit-style reports were generated:
Click the graph to view detailed results for the needed build.
To display the test results of the latest build, click Latest Test Result on the left, or click the rightmost build in the graph.
To view the test results of a build that is not on the graph, open the build’s page and click Test Result.
Test Result Page
You get to the Test Result page by clicking a build link on the Status or History page of your Jenkins project, or by clicking Test Result in the menu on the left.
On the Test Result page, you can examine the results of a test run. Below is a sample view of the page:
At the top of the page, Jenkins displays summary information about the executed tests and their total execution time.
Click add description to specify a description for the test run. You will see it on the Test Result and History pages.
If the test run failed, the page contains the All Failed Tests section (as on the image above). Click an item in this section to view information about the failure.
The All Tests section provides brief information on the executed TestComplete and TestExecute tests during the build process:
Package level results in this section represent project suite runs.
Class level results correspond to projects in a project suite.
Test level results correspond to individual test items or individual tests in a project.
Click items in the All Tests section to view details information about them.
|Tip:||For convenient viewing of test results, install the Test Results Analyzer Jenkins plugin.|
The History page displays the statistics of test runs for your builds. To open the page, select History from the menu on the left. Below is a sample view of the page:
The graph at the top of the page shows the execution time of the tests and the ratio between the failed and passed tests. Click show count to view the number of executed tests rather than time.
The table below the graph contains information on each build: test duration, and the number of failed, skipped and total tests per build. The TestComplete Jenkins plugin does not skip tests, so the number of skipped tests is always 0.
Click a build number in the table to view information about test runs in that build.
TestComplete Test Results for a Build
To view TestExecute test results in Jenkins, open the build page in your browser and click TestComplete Test Results in the menu on the left:
The page displays a summary of TestComplete test runs, information on what nodes the tests ran, their run time, and the number of logged errors and warnings.
Depending on the test results, the following statuses can be displayed:
|Failed to start||The test did not start. Click the test name to find out what happened.|
|Failed||Errors occurred during the test execution, or the test did not finish.|
|Warning||Warning messages were logged, but no errors occurred and the test finished.|
|Passed||No errors or warnings occurred during the test execution.|
To view a detailed test log of a test run, click the test name. The TestComplete Test Result report for the run will be opened:
The report is similar to the TestExecute test log.
To download the test log in the .tcLogX format , click the Download Log File (tcLogX) button:
To view a .tcLogX file, use TestComplete. Add it to your TestComplete project:
In your project, right-click the Project_name Logs item in the Project Explorer and select Add | Existing Log File from the context menu.
Navigate to the .tcLogX file using the standard Open File dialog and click Open.
TestComplete will add the file to your project and you will be able to view it in the Test Log panel.
If generating MHT logs was enabled for your tests (see the description of the Generate MHT Log File option of the TestComplete Test step or the description of the
generateMHT parameter of the step for Pipeline scripts), you can download test results in the .mht format. Click the Download Log File (MHT) button:
|Note:||You can open .mht files only in Internet Explorer.|
Accessing TestComplete Test Results Through APIs
Jenkins provides remote access API for its functionality. TestComplete plugin is also created so that you can access test results in the API form. The following data formats are supported:
To access TestComplete test results in the API form, add .../api/apiname to the URL. The API name should be in lower case. For example, the XML format for Job1 run on localhost, the URL will look like this:
Remote access API has the following structure:
If you use XML, the root node of the summary page is
tcSummaryAction and of individual reports pages -
If you use JSON or Python, the root node of the summary page is
tcSummaryAction and for individual reports, there is no root node.
Child nodes are the same for all data formats: