Continuous Integration with Ranorex

Continuous Integration is a hot topic in the world of automated testing, and Ranorex provides some great integrations for this.
It integrates directly with Git and GitHub through the Ranorex Studio IDE, Ranorex provide a Jenkins Plug-In for Test Execution, and as Ranorex is .NET, we can even automate the build of our Ranorex projects using Microsoft’s MSBuild.exe!

So here is an overview of the Continuous Integration demo we will see in the videos:

Ranorex CI Overview

  1. Push your Ranorex Project up to GitHub
  2. Jenkins Polls the GitHub Repo for changes
  3. If there is a change, then Jenkins Pulls the Project from GitHub down to the local Jenkins Workspace, Our Jenkins Job then performs the build steps:
  • Build the Ranorex project in the Jenkins Workspace using MSBuild.exe
  • Execute the Compiled TestSuite using the Ranorex plugin
  • return the JUnit Test Results to Jenkins

4. Jenkins Publishes the Test Results, and Emails them to interested parties

Tools Required

In this example, we will be using a Jenkins Server, and a Jenkins Node/Slave with Ranorex installed.

Videos

Notes

When integrating Ranorex & Git, there are certain files you may not want to track in Git, such as the Test Suite Results files you generate. To solve this, you can create a text file in the Ranorex project where the hidden .git folder is. The text file should be named .gitignore and you can then specify in it what files to ignore. You can use regular expression syntax in here. Here is an example of the entries I have in mine:

[Rr]eports
 *.rxlog
 *.rxlog.data
 *.jpg
 *.rxuser
 RanorexReport.css
 RanorexReport.png
 RanorexReport.xsl

For the Jenkins integration, I demonstrated using a Ranorex Project in GitHub as the build trigger, however, you may want to poll an application build in a GitHub Repository. If there is a new build of the application under test, then you may want to pull that to the workspace, as well as the Ranorex Project in another GitHub repository – so you are now dealing with multiple GitHub repositories in one Jenkins Job! If this is the case then have a look at another Jenkins plugin called Multiple SCM