Skip to main content

Automation Testing Overview

Introduction to Automation Testing with QA Sphere

In the fast-paced world of software development, automation testing has become an essential component of maintaining high-quality, reliable applications. QA Sphere recognizes this need and provides robust tools to integrate your automated testing processes seamlessly into your overall quality assurance workflow.

The Power of Integration

QA Sphere offers two primary methods for integrating your automation testing efforts with our platform:

  1. REST API: For developers and teams looking for maximum flexibility and customization.
  2. QA Sphere CLI Tool: For quick, easy integration, especially suited for CI/CD pipelines.

Both of these methods allow you to automate the process of uploading test results, linking them to existing test cases, and maintaining a comprehensive view of your testing efforts.

REST API: Flexibility and Control

Our REST API provides a programmatic interface to QA Sphere, allowing you to:

  • Upload test results
  • Create and manage test cases
  • Update test run statuses
  • Retrieve detailed testing information

This level of access enables you to build custom integrations tailored to your specific workflow and tooling, making QA Sphere a central hub for all your testing data.

QA Sphere CLI Tool: Simplicity and Efficiency

For teams looking for a more straightforward approach, our Command Line Interface (CLI) tool offers a user-friendly way to integrate automated test results. Key features include:

  • Easy installation and setup
  • Direct upload of JUnit XML results
  • Automatic matching of test cases
  • Support for attachments and error handling

The CLI tool is particularly useful for quickly integrating with CI/CD pipelines, allowing you to automate result reporting as part of your build and deployment processes.

QA Sphere Automation Quick Start Guide

QA Sphere seamlessly integrates with any test automation tool and framework, allowing you to effortlessly report your test results for comprehensive test automation management. Whether you're using CI/CD pipelines, a build server, or manually running your automated tests, QA Sphere's integration process remains consistent:

  1. Build your test suite using your preferred automation framework and tools
  2. Generate standard JUnit-style XML report files from your automation tool
  3. Submit results to QA Sphere using our versatile CLI tool

Once submitted, your test results are automatically processed in QA Sphere, enabling rich reporting and detailed test automation tracking. Follow this quickstart guide to send your first test automation results to QA Sphere in just a few minutes.

Step 1: Run Your Tests & Generate XML File

Begin by creating your automated tests using your favorite test automation tool and framework. After running your tests, configure your automation tool to generate JUnit-style XML files. This format has become a standard for exchanging test results between tools and is supported, either directly or indirectly, by virtually all automation tools.

Step 2: Install the QAS CLI Tool

To submit your test results to QA Sphere, you'll use our cross-platform qasphere CLI tool. This tool is distributed as an NPM package, making it easy to install on any system. Install our official qas-cli NPM package using the following command:

$ npm install -g qas-cli
$ qasphere --version

Step 3: Set Up Environment Variables

Before submitting results, you need to set up the required environment variables. Create a .qaspherecli file in your project directory or one of its parent directories with the following content:

QAS_TOKEN=your_api_token_here

Replace your_api_token_here with the API token generated from your QA Sphere profile page.

Step 4: Submit Test Results to QA Sphere

Now you're ready to send the test results to QA Sphere. Use the qasphere CLI tool to submit your results:

$ qasphere junit-upload \
-r https://qas.eu1.qasphere.com/project/YOUR_PROJECT_CODE/run/RUN_ID \
./path/to/junit.xml

Replace YOUR_PROJECT_CODE with your actual project code and RUN_ID with the ID of the test run you want to update. If you want to create a new test run, omit the RUN_ID.

That's it! 🎉 This command will automatically:

  • Analyze the XML result file
  • Create a new test run in QA Sphere (if no RUN_ID is provided)
  • Submit all tests and results
  • Link the results to existing test cases in QA Sphere

There's no need to manually create tests, map tests or IDs, or build any custom API code. QA Sphere handles everything automatically for you.

Additional Options

  • To upload multiple XML files, use: qasphere junit-upload -r URL_AS_ABOVE ./*.xml
  • To include attachments with your test results, add the --attachments flag
  • For more options and commands, use qasphere junit-upload -h

Best Practices

  1. Consistent Naming: Ensure your test case names in the XML report contain QA Sphere test case references (e.g., PROJECT-SEQUENCE) for accurate matching.
  2. Regular Updates: Integrate this submission process into your CI/CD pipeline for real-time test result updates.
  3. Error Handling: Use the --force option to continue uploads even when encountering non-critical errors.

By following this guide, you've successfully integrated your test automation with QA Sphere. Enjoy the benefits of comprehensive test management and insightful reporting for your automated tests!