Before you create a Jenkins project for Ranorex test execution, install the required dependencies, start Jenkins in an interactive Windows session, and complete the initial Jenkins configuration.
Prerequisites
Make sure you have:
- Downloaded and installed Jenkins.
- Installed the correct Java version.
- Added the Ranorex Studio solution to a GitHub repository.
Check the Java Version
Jenkins requires Java. To check the installed Java version:
- Open Command Prompt or PowerShell.
Run the following command:
java --version- Confirm that the required Java version is installed.
Configure the Java Environment Variables
If Java is installed but the java command is not recognized, configure the Java environment variables.
To configure the variables:
- Press the Windows key and enter PowerShell.
- Right-click Windows PowerShell and select Run as administrator.
Set the JAVA_HOME environment variable:
[Environment]::SetEnvironmentVariable("JAVA_HOME", "C:\Program Files\Java\jdk-21.0.5+11", "Machine")Add the Java bin directory to the system Path:
[Environment]::SetEnvironmentVariable("Path", $env:Path + ";C:\Program Files\Java\jdk-21.0.5+11\bin", "Machine")- Close and reopen Command Prompt or PowerShell.
- Run
java --versionagain to confirm that Java is available.
Start Jenkins in an Interactive Session
Ranorex performs UI automation and therefore requires access to the Windows desktop session. Run Jenkins interactively under a logged-in Windows user.
The recommended setup is:
- A Windows user is logged in.
- Jenkins runs interactively in that user's session.
- The Jenkins project starts the Ranorex UI test.
To start Jenkins:
- Open Command Prompt or PowerShell as an administrator.
Go to the directory where Jenkins is installed. For example:
cd C:\JenkinsStart Jenkins:
java -jar jenkins.warWait until Jenkins displays the following message:
Jenkins is fully up and runningOpen the following address in a browser:
http://localhost:8080- Keep the terminal window open while executing Ranorex tests.
Unlock Jenkins
When you open a new Jenkins installation for the first time, Jenkins prompts you for an administrator password.
To retrieve the password:
Open the following file:
C:\Users\<username>\.jenkins\secrets\initialAdminPassword- Copy the password.
- Paste it into the Administrator password field on the Unlock Jenkins page.
Click Continue.
Complete the Initial Plugin Setup
After you unlock Jenkins:
- On the Customize Jenkins page, select Select plugins to install.
- Select the plugins required for the initial Jenkins setup.
- Install the selected plugins.
The following plugins are included in the setup shown in this guide:
GitHub: Enables Jenkins integration with GitHub.
JUnit: Allows Jenkins to publish JUnit test results. This plugin is optional.
The MSBuild plugin is not required for the basic Ranorex integration. Install it only if Jenkins must build the Ranorex solution before running the test.
Create the Administrator User
After Jenkins installs the selected plugins:
- On the Create First Admin User page, enter the required user information.
- Confirm the password.
- Enter the full name and email address.
Save the administrator user.
When the Jenkins is ready page appears, continue to the Jenkins dashboard.
Install the Ranorex Test Execution Plugin
After the initial Jenkins setup is complete, install the Ranorex plugin.
To install the plugin:
- From the Jenkins dashboard, select Manage Jenkins.
Select Plugins.
Open the Available plugins tab.
- Search for Ranorex.
Select Ranorex Test Execution Execution Plugin.
- Install the plugin.
After the plugin is installed, you can create and configure a Jenkins Freestyle project.