Running Ranorex Webtestit in Jenkins for Continuous Integration


#1

The following describes the necessary steps to create a build process with Jenkins.

Make sure you open a new command prompt/terminal after installing the dependencies used by Webtestit and restart the agent so the new environment variables get recognised.
Also, if you have Ranorex Webtestit application opened before starting the build, make sure that you close it, otherwise you will get the “Cannot run multiple instances” error.

Windows

  1. You need to run the Jenkins service as a user account. Follow the instructions on the official documentation.
    Alternatively, you can use a Jenkins slave in interactive mode.
    For more information check the official documentation.

  2. Install Ranorex Webtestit with the user you start the Jenkins service with

  3. Make sure you follow the instructions to setup the java jdk on the Jenkins server/slave

  4. Make sure to install all browsers you want to test on the Jenkins server/slave

  5. Restart the agent using a NEW command prompt window

  6. If you like to publish your test results make sure you install the JUnit-Plugin

  7. In your job add a Execute Windows batch command build step

  8. Add the following command: "%LOCALAPPDATA%\Programs\webtestit\Ranorex Webtestit.exe" run --report-file-destination="%WORKSPACE%\testresults" --endpoints-config="/Users/mgrundner/Desktop\endpoints.json" "%WORKSPACE%\path\to\your\project"

  9. Under Advanced Project Options, check use custom workspace checkbox. Enter the location of your project in the Directory field.

  10. Add a Publish JUnit test result report Post-build Action

  11. Set the Test report XMLs include set to testresults\*.xml

  12. Now you can run your build and see the result
    2018-05-17%2010_37_53-Microsoft%20Edge

MacOS

  1. You need to run the Jenkins agent as Launch agent. See the official documentation

  2. Install Ranorex Webtestit with the user you start the Jenkins agent with.

  3. Make sure you follow the instructions to setup the java jdk on the Jenkins server/slave

  4. Make sure to install all browsers you want to test on the Jenkins server/slave

  5. Restart the agent using a NEW terminal window

  6. If you like to publish your test results make sure you install the JUnit-Plugin

  7. In your job add a Execute shell build step

  8. Add the following command: /Applications/Ranorex\ Webtestit.app/Contents/MacOS/Ranorex\ Webtestit run --report-file-destination=/users/yourUsername/yourProjectPath/reports --endpoints-config=/Users/yourUsername/locationOfEndpointFile Users/YourUsername/yourProjectPath

  9. Under Advanced Project Options, check use custom workspace checkbox. Enter the location of your project in the Directory field.

  10. Add a Publish JUnit test result report Post-build Action

  11. Set the Test report XMLs include set to testresults/*.xml

  12. Now you can run your build and see the result
    2018-05-17%2010_37_53-Microsoft%20Edge

Linux

  1. You need to run the Jenkins agent as Launch agent. Follow the instructions on this excellent blog post.
    Alternatively, you can use a Jenkins slave.
    For more information check the official documentation.

  2. Install Ranorex Webtestit with the user you start the Jenkins agent with.

  3. Make sure you follow the instructions to setup the java jdk on the Jenkins server/slave

  4. Make sure to install all browsers you want to test on the Jenkins server/slave

  5. Restart the agent using a NEW terminal window

  6. If you like to publish your test results make sure you install the JUnit-Plugin

  7. In your job add a Execute shell build step

  8. Add the following command: "/opt/Ranorex Webtestit/webtestit"" run --report-file-destination="${WORKSPACE$}/testresults" --endpoints-config="$C:\Users\mgrundner\Desktop\endpoints.json" "${WORKSPACE$}/path/to/your/project"

  9. Under Advanced Project Options, check use custom workspace checkbox. Enter the location of your project in the Directory field.

  10. Add a Publish JUnit test result report Post-build Action

  11. Set the Test report XMLs include set to testresults/*.xml

  12. Now you can run your build and see the result
    2018-05-17%2010_37_53-Microsoft%20Edge

Further topics: Command Line Interface (CLI)


Creating Jenkins Job with Webtestit-- Do we have to specify the location of the json file?
Report tab always opens in dark theme
Running with Jenkins : MacOS documentation, end point configuration contains Windows dir path
Jenkins integration : Junit-plugin shall be installed before configuring the job
Jenkins Integration: End point configuration path is not available for Windows configuration
Jenkins Integration: Online docummentation
Runnung a test without webtestit installed
Runnung a test without webtestit installed
unlisted #2

Release notes v0.6.0
listed #3