Blog QA Touch

How to Sync Selenium Java BDD Automation Results with QA Touch?

September 12, 2023
Java BDD Automation

As a team, we are always striving to have better integration of our all test results in one centralized place. The QA Touch team provided the sample snippet for  Selenium with TestNG with a sample project. But in our organization, we have a test automation environment with Selenium, Java, BDD, and Junit framework.  So, we extended that and updated it to be compatible with the BDD cucumber framework. I wanted to share my journey with the QA Touch community, so everyone who is using this automation setup will benefit.

Let us see an example of how you can set it up.

Setting up the Automation Code

Make a note that this article is written in mind that the Selenium and Test Automation environment is already available. We are going to see how to set up the syncing of test results of the sample automation project, Selenium, Cucumber BDD, and Junit framework to QA Touch. Note that the screenshots and the execution steps mentioned in the article are based on IntelliJ IDE.

Download the sample project from the Github repository from Selenium Java – BDD – QA Touch Integration Sample and import it into your test automation environment. Execute as a Scenario to confirm the test is executed without any errors because of the environment changes.  

Recommended Read: Selenium With Python Tutorial

Sync Test Results from Java Selenium BDD to QA Touch

Next, we are going to see about setting up the synchronization of the test results process. The steps are below:

  1. Login in QA Touch.
  2. Click the Project in which you want to sync the test automation results.
  3. Create a test run for the test automation execution.
  4. In this sample project, we have a single test case. Add the test case code from QA Touch. For example, it is TC0001. The below screenshot shows this.

 Java Selenium BDD to QA Touch

5. Go to your sample test automation project, open the feature file, update the method name under Scenario: TC0001_Google Search and Save it. The snippet will look like below:

Automation Project

6. Set up the project folder structure like the screenshot below:

project folder structure

7. Access the QA Touch application and get the details from the Test run – config popup.

8. Configure the data API token, and domain name in the file QAtouchAPIClient.java as shown below:

data API token

9. Update the project and test run ID details in the Hooks.java file.

Hooks.java file

10. Run the Test in the Feature file with the Run Scenario option as below screenshot.

Run the Test in the Feature file

11. The execution log is below:

execution log

12. Go to the test run in QA Touch to see the test results. The test result snapshot after the update.

 test run in QA Touch

I hope this blog helps to understand how can we automate the test run result sync 

process by leveraging QA Touch API for Java Cucumber BDD test results.

Feel free to reach out to the team at support@qatouch.com for new feature requests.

Leave a Reply