Setting Up LoadComplete Tests in Jenkins for Pipeline Jobs

Applies to LoadComplete 4.97, last modified on May 20, 2019

To run your LoadComplete tests as part of a Jenkins Pipeline job, create a Pipeline script. The script will include statements that will start your LoadComplete test. It may also include statements that will perform other tasks, (for instance, they may copy LoadComplete project files to a working folder).

Create a Pipeline script

  1. In the Pipeline section, choose Pipeline script from the Definition drop-down list.

  2. In the Script edit box, specify Pipeline script statements that will run a LoadComplete test.

    An example of a pipeline script

    Click the image to enlarge it.

For instance, the script below launches LoadComplete 4 and runs the Order test of the Basic project.

node{
 loadcompletetest executorVersion: '4', project: 'Basic Test Project\\Basic.ltp', test: 'Order'
}

If you are not familiar with script writing, you can use the Jenkins Snippet Generator. It allows specifying task settings to generate a script that will perform the task automatically. You can copy the script and paste it to the Script edit box:

  1. Click the Pipeline Syntax link.

    Opening the Snippet Generator

    Click the image to enlarge it.

    The Snippet Generator window will appear.

  2. In the Sample Step drop-down list, select loadcompletetest: LoadComplete Test.

    The Snippet Generator window

    Click the image to enlarge it.

  3. Specify your test project in the Project field.

    Note: The path should be relative to the job’s working folder on the node.
  4. In the Test name field, specify the name of the test to run.

  5. Click Advanced to configure the following additional settings of the LoadComplete Test step:

    Option Description
    LoadComplete version Specifies the LoadComplete version to be used in case several versions of the product are installed on the node. Jenkins uses the latest installed version by default.
    Action on warnings Specifies whether Jenkins should mark the entire build as failed or unstable when the LoadComplete test log contains warnings.
    Action on errors Specifies whether Jenkins should mark the entire build as failed or unstable when the LoadComplete test log contains errors.
    Use test timeout Specifies the maximum test execution time in seconds. The timeout includes both the startup time of LoadComplete and the test run time. If the test is not finished until the specified period elapses, Jenkins will mark the entire build as failed.
    Generate PDF log file If this option is enabled (by default), LoadComplete exports test results to a .pdf file after the build is over. You can download this file from the Jenkins page displaying test results. If this option is disabled, LoadComplete does not export test results in the PDF format, but you can still view the results in Jenkins. See Viewing LoadComplete Test Results in Jenkins.
    Generate MHT log file If this option is enabled, LoadComplete exports test results to a .mht file after the build is over. You can download this file from the Jenkins page displaying test results. If this option is disabled (by default), LoadComplete does not export test results in the PDF format, but you can still view the results in Jenkins. See Viewing LoadComplete Test Results in Jenkins.
  6. Click Generate Pipeline Script. Jenkins will generate the Pipeline script. You can then copy and paste it to the Script edit box of your Pipeline job.

    The generated pipeline script

    Click the image to enlarge it.

See Also

Integration With Jenkins
Preparing for Running LoadComplete Tests

Highlight search results