Create a Jenkins Freestyle project to retrieve a Ranorex Studio solution from GitHub and run its test suite with the Ranorex Test Execution plugin.
Prerequisites
Make sure you have:
- Completed the initial Jenkins setup.
- Started Jenkins in an interactive Windows session.
- Installed the Ranorex Test Execution plugin.
- Added the Ranorex Studio solution to a GitHub repository.
- Created a GitHub personal access token for Jenkins.
Add GitHub Credentials
Add the GitHub credentials that Jenkins will use to access the repository.
To add the credentials:
- From the Jenkins dashboard, select Manage Jenkins > Credentials.
- Select System.
- Select Global credentials.
- Click Add Credentials.
- From Kind, select Username with password.
- Configure the credential:
- Username: Enter your GitHub username.
- Password: Enter your GitHub personal access token.
- ID: Enter the name of the GitHub repository that contains the Ranorex solution.
Example:
github-ranorex-demo- Click Create or Save.
Create the Freestyle Project
To create the project:
- From the Jenkins dashboard, select New Item.
- Enter a name for the Jenkins project.
- Select Freestyle project.
- Click OK.
Jenkins opens the project configuration page.
Configure the GitHub Repository
Configure the source code management settings so Jenkins can retrieve the Ranorex solution from GitHub.
To configure the repository:
- In the Jenkins project configuration, go to Source Code Management.
- Select Git.
- In Repository URL, enter the GitHub repository URL.
- From Credentials, select the GitHub credential created earlier.
- Under Branches to build, enter the branch.
Example
- Repository: https://github.com/company/ranorex-demo.git
- Credentials: github-ranorex-demo
- Branch: */main
Add the Ranorex Test Execution Build Step
Add the build step that runs the Ranorex test suite.
To add the build step:
- Go to Build Steps.
- Click Add build step.
- Select Run a Ranorex test suite.
- Configure:
- The Ranorex test suite or project location.
- The test execution settings.
- The report options.
The Ranorex Test Execution plugin:
- Starts the test suite.
- Executes the Ranorex tests.
- Collects the results.
- Publishes the Ranorex report.
For the basic integration, you do not need to add:
- An Execute Windows batch command build step.
- A manual call to the test executable.
- A separate MSBuild step.
Run the Jenkins Project
To run the project:
- Click Save.
- Click Build Now.
Jenkins performs the following actions:
- Checks out the Ranorex project from GitHub.
- Runs the Ranorex test suite.
- Generates the Ranorex report.
- Displays the test results.