This article explains how to create an Azure DevOps YAML pipeline that builds a Ranorex Studio solution, runs the generated test executable, and publishes test results and Ranorex report artifacts.
Use this workflow if you want to store your pipeline configuration in your Azure Repo.
Before You Begin
Make sure you have:
- An Azure DevOps project and Git repository. See Create ADO Project and Git Repo.
- A configured and running Azure Pipelines agent. See Set Up an Azure Pipelines Agent.
- A Ranorex Studio solution is committed and pushed to your Azure Repo.
- Permission to create pipelines in the Azure DevOps project.
- Read access to the repository that contains your Ranorex Studio solution.
Add the YAML File to Your Azure Repo
Download the provided Ranorex_ado_pipeline.yaml file and add it to the root folder of your Azure Repo.
Before you run the pipeline, update the placeholder values in the YAML file with the names of your Ranorex Studio solution and project.
In the command line below, replace:
# 4. Run the test executable and generate JUnit and zipped reports
- task: CmdLine@2
displayName: 'Run the test executable'
inputs:
script: |
if not exist "$(System.DefaultWorkingDirectory)\Reports" mkdir
"$(System.DefaultWorkingDirectory)\Reports"
"$(System.DefaultWorkingDirectory)\YourSolutionName\YourProjectName\bin\$(buildConfiguration)\YourProjectName.exe"
/junit /junitf:"$(System.DefaultWorkingDirectory)\Reports\report.junit.xml"
/zr /zrf:"$(System.DefaultWorkingDirectory)\Reports\Report.rxzlog"- YourSolutionName with the folder name of your Ranorex Studio solution.
- YourProjectName with the folder name of your Ranorex Studio project and the name of the generated executable.
Find Your Solution and Project Names
To find your project name, open your Ranorex Studio solution folder and review the folder structure.
The folder inside your solution folder usually matches the project name. The generated executable usually has the same name as the project.
Create the Pipeline in Azure DevOps
After you add the YAML file to your repository, create the pipeline in Azure DevOps.
- In your Azure DevOps project, go to Pipelines.
- Select New pipeline.
- Select Azure Repos Git.
- Select the repository that contains your Ranorex Studio solution.
- If prompted, select Existing Azure Pipelines YAML file.
- Select Ranorex_ado_pipeline.yaml.
- Review the pipeline configuration.
- Select Run.
On the first run, Azure DevOps may prompt you to authorize resources. Select Authorize resources to grant the pipeline access to the repository.