How we integrated Ranorex and Appium with Azure DevOps
How to Integrate Ranorex and Appium with Azure DevOps for CI/CD
DevOps

How we integrated Ranorex and Appium with Azure DevOps

Building a test automation framework requires integration of various tools and technologies. Clients possess various technology stacks and it’s important for everything to work in tandem for continuous testing of applications. We faced one such challenge where we had to integrate Ranorex and Appium.

This blog walks you through the process of Ranorex-Appium integration with Azure DevOps, streamlining testing process.

Key Challenges in Tools Integration

Before diving into the solution, it’s helpful to understand the challenges we face. Ranorex, a powerful UI testing tool, and Appium, known for its flexibility in mobile testing, are each ideal for different aspects of our testing needs.

However, integrating them seamlessly posed several hurdles:

  • Running Tests: Ensuring Ranorex could invoke and execute Appium scripts without interruption to maintain workflow continuity.
  • Dependency Management: Handling dependencies to ensure smooth, synchronized execution between the tools.
  • Reporting and Visibility: Feeding Appium test results back into Ranorex for consolidated visibility and tracking.
  • ADO Pipeline Integration: Embedding this framework into our Azure DevOps (ADO) pipeline to support CI/CD, enabling automated execution and real-time reporting.

Approach and Solution

To tackle the integration challenges, we implemented a structured approach that unified Ranorex and Appium workflows while seamlessly integrating them with the Azure DevOps pipeline. This strategy enabled smooth test execution, optimized automation capabilities, and ensured real-time reporting to meet the client’s testing requirements and delivery objectives efficiently.

1. Identifying Requirements

Our first step was defining the requirements for seamless integration:

  • Running both Ranorex and Appium tests within a single, unified suite.
  • Ensuring automation flexibility to handle different modules within a Ranorex test suite.
  • Integrating with Azure DevOps for continuous integration and deployment (CI/CD) to automate test execution and report results efficiently.
2. Linking Ranorex with Appium

To integrate Ranorex with Appium, we created a custom Ranorex module that runs a specific Appium test case from a Java project. This is done using Maven to execute the Appium test via a command-line interface.

Key Steps:

i. Create a Custom Ranorex Module:

— We created a UserCode module in Ranorex that triggers the Appium test using the `mvn.cmd` command.

— This module calls the Maven project, specifically the Appium test (`testLogin()`), using the following command:

ii. Run the Test:

— The module executes the Maven process that triggers the Appium test, isolating the `testLogin` method to run only that specific test.

iii. Capture Logs:

— Output and errors from the Maven process are captured and logged in the Ranorex test report for easy tracking.

3. Linking the Solution to Azure DevOps

To automate the execution of the Ranorex-Appium tests within Azure DevOps, we set up a pipeline that runs our Appium tests using the pre-built AndroidAppium executable. This integration ensures that the testing process is automated and can be triggered from within Azure DevOps. Here’s how we achieved this:

Create the Azure DevOps YAML Pipeline

We created an Azure DevOps YAML pipeline that automates several key steps:

  • Checks if Java and Maven are installed and available.
  • Runs the AndroidAppium executable to execute the Appium tests.
  • Publishes the test results in JUnit format.

Here’s the YAML pipeline configuration:

Explanation of the YAML Pipeline

  1. Trigger: The pipeline is triggered whenever there are changes in the Repository branch.
  2. Java and Maven Version Check: Ensures that the necessary versions of Java and Maven are installed.
  3. Run Appium Tests: Executes the pre-built AndroidAppium.exe executable from Ranorex solution, which runs the Appium tests.
  4. Publish Test Results: After test execution, the results are published in JUnit format, allowing us to track test outcomes.

Outcome of the Integration

Continuous Integration and Monitoring

With the solution fully integrated into Azure DevOps (ADO), we achieved a seamless continuous integration pipeline that automates the testing process and provides quick feedback loops. Here’s how we enhanced the integration:

  • Automated Triggering: Every code change pushed to the repository automatically triggered the test execution, ensuring that the latest code is always validated by running the Appium tests.
  • Result Monitoring: After the tests ran, the results were immediately available in Azure DevOps, providing real-time insights into the quality of the application. This allowed us to monitor the progress and health of the application continuously.
  • Quick Feedback Loops: By integrating the solution with ADO, we established fast feedback loops, enabling early detection of issues. This made it easier for the team to address bugs quickly and improve the overall application quality.
Email Notifications with PDF Reports:

In addition to the standard test results in ADO, we implemented a custom email notification system using the Ranorex Automation Helpers. After each test run, a PDF report containing detailed execution results is generated and sent to key stakeholders, such as managers and clients. This happens before the JUnit results are published in ADO, ensuring that stakeholders are notified of test outcomes promptly.

The PDF reports contain crucial information, including:
  • Test execution status (pass/fail).
  • Detailed logs of the test run.
  • Any identified issues or failures.

By sending these PDF reports to the responsible parties, we ensured they were kept in the loop on the test progress and could take action if necessary without waiting for the results to appear in ADO.

Achieving Unified Automation with Ranorex and Appium

By integrating Ranorex, Appium, and Azure DevOps, we built a robust, automated testing pipeline that not only streamlined mobile testing but also enhanced our continuous integration process. The customized user code module allowed seamless execution of Appium tests through Ranorex, while the Azure DevOps pipeline enabled automated triggers, real-time monitoring, and quick feedback loops.

Our addition of the Ranorex email module with PDF reporting further strengthened communication, keeping stakeholders updated on test results immediately after each run. This solution enabled faster issue resolution, improved application quality, and provided a scalable framework for future automation needs.

By overcoming each challenge, we have set up a dependable and efficient testing solution that bridges our tools, integrates seamlessly with ADO, and ensures high standards in our Android app quality assurance.

How We Can Support Your Test Automation Goals

At Enhops, we specialize in building customized automation solutions that help organizations to test and deliver high-quality applications. We can work with multiple tools and technologies to integrate testing in your CI/CD pipelines. We ensure your testing processes are seamless and effective through automation and AI-driven strategies.

Explore our ImpactNOW PoC Program to discover how we can assist in developing the right testing solutions for your applications. These frameworks will enable continuous testing and ensure bug-free releases.

Avatar photo
Iniyan Shanmugam
Senior QA Automation Engineer

Seasoned QA professional with over 5 years of experience in automation testing and quality assurance. Specializes in tools and technologies such as Ranorex Studio, Selenium WebDriver, and CI/CD pipelines using Azure DevOps. Expertise includes mobile testing for both iOS and Android platforms, as well as integration testing for complex systems. Currently working at Enhops (A ProArch Company), focused on transforming software quality through innovative automation techniques and ensuring seamless delivery with precision and efficiency.