To run a freestyle Jenkins job that will execute your TestComplete tests, add the TestComplete Test build step to it:
1. Choose nodes to run tests on
The node where you will run tests must have TestComplete or TestExecute installed. To make sure the job will run only on this node, select the Restrict where this project can be run check box and enter the name of the node, where you will run TestComplete tests.
2. Add steps that will prepare testing environments
Before adding a TestComplete Test build step, you need to prepare and copy TestComplete project files, the tested application and other test-related files and folders to the working folder on the node. If these files are absent from the node, Jenkins will be unable to run the test.
You can place all the files to the node beforehand, or you can add one or multiple build steps to your Jenkins job to perform all the preparation tasks. For example, you can use the
Folder Copy operation provided by the File Operations Plugin.
|Note:||TestComplete test project files should reside in the job’s working folder or in its subfolders.|
3. Add TestComplete Test step
In the Build section, click Add build step and choose TestComplete Test from the drop-down list:
The TestComplete Test build step will be added:
Specify the test project suite in the Project suite file field.
Note: The path should be relative to the job’s working folder on the node.
Select the test of the project suite to be run:
Entire suite - Runs the entire project suite.
Project test - Runs a specified project in the project suite.
Tags (TestComplete 14.20 or later is required) - Runs tests of the specified project that match a tag or tag expression.Tag expression syntaxTag expression syntax
@before tag names, that is, use
To combine tags, use the
notoperations, for example:
@tag1 or @tag2
@tag1 and not @tag3
@tag1 and not @tag2 ← Correct!
@tag1 && !@tag1 ← Incorrect!
If needed, you can use braces to group tags, for example:
@tag1 and (@tag2 or @tag3)
(@tag1 or not @tag2) and (not @tag3 or @tag4)
Script test - Runs a script routine.
Keyword test - Runs a keyword test.
Other - Runs any test your project contains: a project test item, a low-level procedure, a unit test, a network suite test, and so on. In the Project text box, enter the name of your project. In the Test name text box, enter the full path to the project item or test item to run. Use vertical bars ( | ) as separators.ExampleExample
The specified test item and all its child test items (if any).
Only those test items that are enabled on the Test Items page of the project will be run.
Keyword test Test1.
Script function Main that is located in the Unit1 script unit.
Low-level procedure LLP1 from the LLCollection1 project item.
Manual test ManualTest1.
Unit test NUnit1 from the UnitTesting1 collection.
API test Test1 from the ReadyAPI1 collection.
Task1 from the Job1 job of the network suite.
Job1 of the network suite.
The test path should contain collection names only. Do not include any project folders in the path.
CrossBrowserTesting tests – (Obsolete) Runs tests defined in the CrossBrowserTesting manager.
This approach to run tests in CrossBrowserTesting environments is deprecated starting with TestComplete 14.40. Starting with TestComplete 14.72, it is removed from the product. If you have TestComplete 14.72 installed on your Jenkins agents, your test run will fail.
To run tests in CrossBrowserTesting environments, we recommend that you use the cross-platform web tests.
Click Advanced to configure additional settings of the TestComplete Test step:
Test runner - Specifies the product that the step will use for the test run. If several products are installed and (Any) is selected, TestExecute is run.
Note: The selected product must be installed on the node. If the 64-bit version of the product is available on the node, it will be used to run tests. Otherwise, the 32-bit version will be used.
Version - Specifies the product version to be used in case you have several versions of these products installed on the node. Jenkins uses the latest installed version by default, and we recommend using the default setting to avoid problems with running your tests in the latest product versions.
Access key - If you use SmartBear License Management to control your TestComplete (and TestExecute) licenses, you can specify the access key assigned to your SmartBear account. This key will be used to license the TestComplete (TestExecute) instances that will run tests.
To add a new key, click Add and specify the key in the resulting dialog. To store the key, use the secret text credentials type.Learn how to get the access keyLearn how to get the access key
Log in to the SmartBear Licensing Portal with your SmartBear ID (email and password) and select > Access Key at the top right of the page:
Action on warnings - Specifies whether Jenkins should mark the entire build as failed or unstable when the TestComplete test log contains warnings.
Action on errors - Specifies whether Jenkins should mark the entire build as failed or unstable when the TestComplete test log contains errors.
Additional command-line arguments - Specifies arbitrary command-line arguments to be passed to TestComplete. To learn more about the TestComplete command line, see TestComplete Command Line.
Use test timeout - Specifies the maximum test execution time in seconds.
The timeout includes both the startup time of TestComplete (TestExecute) and the test run time.
If the test is not finished until the specified period elapses, Jenkins will mark the entire build as failed.
This option is effective only if you use TestComplete or TestExecute 10.60 or later.
If this option is disabled and Jenkins is running as a service, your TestComplete tests will fail.
For information on when you need to use this option, see Requirements.
Credentials - Specifies the user name/password pair of the account that will be used to run the test. To add a new pair, click Add and specify the credentials in the resulting dialog.
Use active session - Specifies whether an existing user session will be used to run a TestComplete test. If it is selected, TestComplete will run in the current session. Otherwise, Jenkins will close all the applications, terminate the currently active session, start a new session under the specified user account and then start the test.
Note: Jenkins will not stop the user session if another user is logged on.
Session screen resolution - Select a screen resolution for the user session in which your TestComplete test will run. The default value is 1280×1024.
If you use a TestComplete version earlier than 12.30, the specified screen resolution will be ignored and the default screen resolution (1280×1024) will be used.
If the Use active session option is enabled, the specified screen resolution will be ignored and the actual screen resolution of the corresponding user session will be used.
Note: The maximum resolution that can be set for a user session depends on the operating system version and on the Remote Desktop Protocol version installed on the target computer. To learn more, see Remote Desktop Protocol Maximum Supported Resolutions.
Generate MHT log file - If this option is enabled, TestComplete 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, TestComplete does not export test results in the MHT format, but you can still examine results in Jenkins. See Viewing TestComplete Test Results in Jenkins.
Generate JUnit-style report - Specifies whether Jenkins will generate JUnit-style reports. For more information on how JUnit reports are represented in Jenkins, see Viewing TestComplete Test Results in Jenkins.
Note: This JUnit-style report slightly differs from standard JUnit reports. To generate JUnit reports, use the
/ExportSummarycommand line argument. You can specify it in the Additional command-line arguments text box of the step. To learn more about the argument, see TestComplete Command Line.
Here is a sample setup of a TestComplete Test build step: