To run a Ranorex Studio test as part of a Jenkins build, create and configure a Jenkins project. This article explains the Jenkins settings relevant to the Ranorex Test Execution Plugin.
Create Jenkins project
To create a project in Jenkins:
- Click New Item.
- Enter a project name.
- Select Freestyle project.
- Click OK.
After Jenkins creates the project, the project configuration page opens automatically.
Configure Jenkins project
Jenkins projects can be configured in many ways. This article focuses on the settings required to integrate Ranorex Studio tests with Jenkins.
After you create the project, Jenkins opens the project configuration page automatically.
To open the project configuration page later:
- Open the project and click Configure.
Source Code Management
In this section, configure how Jenkins accesses the repository that contains your version-controlled files.
In this example, GitHub is used as the repository provider. To configure source code management:
- In Repository URL, enter the URL of your GitHub repository.
- If your repository requires authentication, select or enter the required credentials under Credentials.
MSBuild step
Add and configure an MSBuild step so Jenkins can build the Ranorex Studio solution correctly:
- Click Add build step.
- Click Build a Visual Studio project or solution using MSBuild.
- Select an MSBuild version (defined as part of plugin configuration).
- Enter the path to the Visual Studio solution file (
.sln) generated for your Ranorex Studio solution. The path must be relative to the root of your version-controlled repository.
Run a Ranorex test suite build step
Finally, add a build step to run the Ranorex test suite:
- Click Add build step.
- Click Run a Ranorex test suite.
- Enter the path to the test suite file (
.rxtst) relative to the solution folder.
Advanced settings
In addition to the required settings, the Run a Ranorex test suite build step includes advanced settings that let you customize the test run.
To access these settings, click Advanced... in the build step.
Ranorex run configuration
Here you can specify the run configuration to use for the test run.
If you do not specify a run configuration, Jenkins uses the run configuration that was active the last time the Ranorex Studio solution was saved.
- The available run configurations in the test suite view in Ranorex Studio
- The desired run configuration needs to be spelled the same way in the Jenkins field
Change report directory, name, and file extension
You can change the default report directory and report name in Jenkins.
If you leave these fields empty, Jenkins uses the default values shown below the fields.
Example
- Custom report directory. The path must be relative to the output folder (bin/debug) of the Ranorex Studio project
- Custom report name with Jenkins variables. You can also use the available Ranorex Studio report name placeholders
- File extension selector: rxlog and xml are available
- The console output when building a project with the above settings
JUnit-compatible report
Many CI systems use the JUnit format to process test result data. When this option is enabled, Ranorex creates an additional copy of the report in JUnit format.
To use this feature:
- Ensure you have the Jenkins JUnit plugin installed and active, as explained in Install and configure plugins.
-
Activate the JUnit-compatible report.
- In the Jenkins project, click Add post build action.
- Click Publish JUnit test result report.
- Under Test report XMLs, enter the Ranorex Studio report directory.
After the build runs, the build summary contains a link to the JUnit report.
Compressed copy of Ranorex report
To create a compressed copy of the report:
- Enable Compressed report copy.
- Enter a custom directory if needed. The path must be relative to the output folder (
bin/Debug) of the Ranorex Studio project. If left empty, the default report directory is used. - Enter a custom name for the compressed report if needed. You can use Jenkins variables and Ranorex Studio placeholders.
Ranorex TestRail integration
These settings let you pass test results to TestRail. They correspond to the command line parameters used for the TestRail integration.
Global parameters
If the test suite contains global parameters, you can define values for them here. These values override the existing parameter values when the build runs.
To define values, use the following format:
ParameterName=Value
Separate multiple parameters with semicolons.
Command line arguments
In this field, you can pass any command line arguments supported by Ranorex Studio.
Archive build artifacts
Build artifacts are files that are created as a result of the build, i.e. the executable build of the test and the report files. You can make these artifacts available for download from Jenkins, which is more convenient than hunting for the files in the respective directories.
To do so:
- In the Jenkins project, click Add post build action.
- Click Archive the artifacts.
- Specify the files you want to archive.
Example
The post-build step archives all files in the /myReports/ directory whose names include the Jenkins build name and build number, and whose file extension contains rx.
After the build finishes, the archived artifacts are available for download in Jenkins.