Sync Selenium Java Test Automation Results with QA Touch


QA Touch API endpoints connect with Selenium Webdriver, which creates robust, browser-based regression automation suites and tests, scales and distributes scripts across many environments, and syncs your automation test results to QA Touch. The steps are below:

Prerequisites:

Java, Selenium, TestNG Framework, and test automation execution environment.

We will see how to set up the syncing of test results of the sample automation project, Selenium, Java, and TestNG framework to QA Touch. The screenshots and the execution steps mentioned in the article are based on Eclipse IDE.

Please see the below Selenium Java - TestNG - QA Touch Integration Git clone command execute your test automation environment. Execute the test and ensure without any errors because of the environment changes.

GitHub Repository Setup


   git clone git@github.com:qatouch/seleniumTestngFramework.git
   cd seleniumTestngFramework

Sync Test Results from Java Selenium TestNG to QA Touch

Next, we are going to set 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.
  5. Go to your sample test automation project, open the test script file, and update the value for the variable run_result_tc_id with your test case ID.

For example, if your test case ID is TC001 then update the value as run_result_tc_id="1"; and Save it.

The snippet will look like below:


    @Test
   public void isSearchExist() {
        run_result_tc_id="1";
      boolean flag = driver.findElement(By.name("q")).isDisplayed();
       Assert.assertTrue(flag);
    }
  1. Set up the project folder structure like the screenshot below:

image

  1. Access the QA Touch application and get the details from the Test run - config popup.
  2. Configure the data API token, and domain name in the file from /src/test/QAtouchAPIClient.java as shown below:

image

  1. Update the project key and the test run ID details in the /src/test/GoogleTest.java file.

image

  1. Run the Test in the Eclipse IDE with the Run option as below screenshot.

image

  1. The execution log is below:

image

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

image