After the build is finished, you can view the results of your LoadComplete tests.
View Test Results in Jenkins
To view LoadComplete test results in Jenkins, open the build page in your browser and click LoadComplete Test Results in the menu on the left:
The page displays a summary of LoadComplete test runs, information on what nodes ran the tests, the run time and the log file that can be downloaded in one of the formats specified in the LoadComplete Test build step.
Depending on the test results, the following statuses can be displayed:
Status | Description |
Failed | Errors occurred during the test run, 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 run. |
You can download the test log in one of the following formats:
-
ZIP – click . The ZIP format is available by default.
-
PDF – click . This format is available if the Generate PDF log file setting of the LoadComplete Test task was enabled.
-
MHT – click . This format is available if the Generate MHT Log File setting of the LoadComplete Test task was enabled.
Note: You can open .mht files only in Internet Explorer.
To view a detailed test log of a test run, click the test name. The LoadComplete Test Result report for the run will be opened:
The report is similar to the LoadComplete Test Log.
Access Test Results by Using API
To get the results of the LoadComplete build step via API, send a GET request to your Jenkins server:
http://localhost:8080/job/My%20Job/241/loadcomplete/api/xml
Here:
-
localhost:8080 — The name and the port of your Jenkins server. The server name in our example is localhost. Instead of the name, you can also specify the server’s IP address. Also, in our example, we use the port 8080 — the default port that Jenkins uses. Your server can use another port.
-
My%20Job — The URL-encoded name of the job that contains the LoadComplete build step.
-
241 — The number of the job run (decimal, integer).
-
xml — A constant that indicates the format of resulting data. In our example we use
xml
. Other possible values includejson
andpython
:http://localhost:8080/job/My%20Job/241/loadcomplete/api/json
http://localhost:8080/job/My%20Job/241/loadcomplete/api/python
The easiest way to get the URL is to open the page with build results in a browser, copy the URL from the browser’s address bar and add a /LoadComplete/api/{data-format}
constant to it:
Result structure
Below is an example of XML data that Jenkins returns. Results in the JSON and Python formats have similar elements:
XML
<LCSummaryAction _class="com.smartbear.jenkins.plugins.loadcomplete.LCSummaryAction">
<report>
<agent>Jenkins</agent>
<details>
<duration>70035</duration>
<timestamp>1535702546409</timestamp>
</details>
<error/>
<exitCode>0</exitCode>
<success>true</success>
<testName>
Basic/Order
</testName>
<url>
http://localhost:8080/job/TestJob/4/loadcomplete/reports/2546408
</url>
</report>
<LCSummaryAction>
If you use the XML format, the root node is LCSummaryAction
. JSON and Python formats don’t use root nodes.
Child nodes:
-
report
— Contains the results of the LoadComplete build step that was run in your job. If your job has several LoadComplete steps, the results will have severalreport
nodes.-
agent
— The name of the node the test was run on. Returns Jenkins if the job was run on the master machine. -
details
— Detailed information on the LoadComplete build step execution. Has the following child nodes:-
duration
— The test run duration in milliseconds. This value is rounded down to seconds. For example, for a test running for 8.124 seconds, this node will return 8000. -
timestamp
— The time passed from January 1, 1970 to the start of the test (in milliseconds).
-
-
error
— The text of an error returned by LoadComplete. Empty if LoadComplete returned no error text. -
exitCode
— The exit code returned by LoadComplete. -
success
— Shows whether the test was successful or not.false
if the test did not start. -
testName
— The full name of the executed test. Includes the project name, project item name, script unit name (for scripts) and test name. -
url
— The URL you can use to see the test results.
-
See Also
Integration With Jenkins
Setting Up LoadComplete Tests in Jenkins for Freestyle Jobs
Setting Up LoadComplete Tests in Jenkins for Pipeline Jobs