QA TOUCH + SELENIUM INTEGRATION

Send Selenium results straight to your QA Touch test run

Connect Selenium WebDriver to QA Touch through API endpoints or Jenkins, and your Java TestNG and Cucumber BDD results update the test run your team already tracks.

3 sync routes · TestNG, Cucumber BDD, Jenkins

Selenium runs the tests, QA Touch keeps the record

Selenium WebDriver builds browser-based regression suites that can be scaled and distributed across many environments. QA Touch API endpoints connect with it and sync the automation results into a QA Touch test run.

  • Results land on the right caseA test case code in your test tells QA Touch which case to update.
  • Authenticated with two headersEvery API request carries your domain and api-token.
  • Keep your frameworkTestNG, or Cucumber with JUnit, stays as it is. Jenkins can do the sync for you.

What the integration covers

Everything below comes from the QA Touch Selenium guides.

Sync through QA Touch API endpoints

Pass the project, test run and result for a test case from your Selenium code. The sample files AddResultNew.java and GoogleTest.java show the calls, and the API base is https://api.qatouch.com/api/v1/.

Java TestNG

Tag a @Test method with its test case ID and run it from your IDE.

Java BDD

Cucumber scenarios with JUnit, named with the test case code.

Build from QA Touch via Jenkins

Map a Jenkins project to a test run, then click Build Now in QA Touch.

Windows, macOS, Linux

Selenium is platform independent, so the same tests run on each.

Pick your sync route

Each route ends the same way: results appear in the QA Touch test run. They differ in how a test is matched to its case.

TestNG testSelenium WebDriver
QAtouchAPIClient.javadomain + API token
QA Touch APIproject key + test run ID
Test runresult updated

Match by test case ID

Set run_result_tc_id inside the test. For test case TC001 the value is "1". The project key and test run ID are set in GoogleTest.java.

@Test
public void isSearchExist() {
    run_result_tc_id="1";
    boolean flag = driver.findElement(By.name("q")).isDisplayed();
    Assert.assertTrue(flag);
}
Cucumber scenarioSelenium + JUnit
Hooks.javaproject key + test run ID
QAtouchAPIClient.javadomain + API token
Test runresult updated

Match by scenario name

Start the scenario name with the QA Touch test case code, then run it with the Run Scenario option in your IDE.

Feature: Google Search

Scenario: TC0001_Google Search
  Given I am on the Google search page
TestNG testnamed with the run code
Jenkins projectmapped in QA Touch
Build Nowclicked in QA Touch
Test runresults synchronized

Match by test run code

Name the test method with the test run code, e.g. TR0001. In QA Touch click Map Project, choose the project, test run and TestNG results, then start the build from QA Touch.

@Test
public void TR0001__test() throws Exception {
    driver.get("https://www.qatouch.com/");
    ...
}

Why QA teams connect Selenium

Less custom sync code

With Jenkins, QA Touch syncs TestNG results directly, so you can focus on architecting your automation scripts.

One place for run status

Automated results update the same test run QA Touch uses to track execution status.

Start from a working sample

Sample TestNG, Java BDD and Jenkins projects let you confirm your environment before you wire in QA Touch.

Reuse scripts across environments

Selenium’s open-source, platform-independent design lets teams reuse test scripts on Windows, macOS and Linux.

Who uses it, and how

Automation engineer

Keep the TestNG suite, add one line

Does
Sets run_result_tc_id in each test and runs it from the IDE.
Sees
The execution log, then the updated result in the test run.
BDD team

Name scenarios with the case code

Does
Writes TC0001_Google Search style scenario names in the feature file.
Sees
Each scenario’s result on its QA Touch test case.
CI owner

Run builds from QA Touch

Does
Maps the Jenkins project to a QA Touch test run and clicks Build Now.
Sees
The build list in QA Touch and synchronized results afterwards.
QA lead

Check automation status in the run

Does
Opens the test run created for the automation execution.
Sees
Results updated by the Selenium run, without re-entering them.

Set it up

Steps for the API routes, from the QA Touch documentation. The Jenkins route follows its own guide below.

JavaSeleniumTestNG, or JUnit with CucumberTest automation environmentQA Touch API key
  1. Get a sample project

    Clone the TestNG sample, run it, and confirm it passes in your environment.

    git clone git@github.com:qatouch/seleniumTestngFramework.git
    cd seleniumTestngFramework
  2. Create a test run

    In QA Touch open your project and create a test run for the automation execution.

  3. Add the test case code

    Take the code from QA Touch (e.g. TC0001) into your test: run_result_tc_id in TestNG, the scenario name in BDD.

  4. Generate your API key

    User → Edit profile → General settings → Generate API Key.

  5. Open the test run config

    Get your domain, project key and test run ID from the test run config popup.

  6. Set the API token and domain

    Edit QAtouchAPIClient.java (under src/test; apicucumber/src/test in the BDD sample).

  7. Set project key and test run ID

    In GoogleTest.java for TestNG, or Hooks.java for BDD.

  8. Run the test

    Use Run in your IDE, or Run Scenario for a feature file.

  9. Check the test run

    Open the test run in QA Touch. The result is updated.

Check your plan. The Selenium Test Result Sync guide states that the QA Touch API is a Professional and Enterprise plan feature.

Sample repositories: TestNG · Java BDD · Java API sync · Jenkins

Frequently asked questions

How do I sync Selenium test results to QA Touch?

There are three documented routes. Call the QA Touch API from a Java TestNG project, from a Java BDD project (Cucumber with JUnit), or let Jenkins sync TestNG results after you map a Jenkins project to a QA Touch test run.

For the API routes: Java, Selenium, the TestNG framework (or JUnit with Cucumber for BDD), a test automation execution environment and a QA Touch API key.

Go to User → Edit profile, and under General settings click Generate API Key. Requests need the domain and api-token headers. The Selenium Test Result Sync guide notes that the QA Touch API is a Professional and Enterprise plan feature.

You add the test case code from QA Touch to your test. In TestNG set run_result_tc_id (for TC001 use "1"), in Cucumber start the scenario name with the code (TC0001_Google Search), and for the Jenkins route name the method with the test run code (TR0001__test()). The project key and test run ID go into the sample files.

Yes. Once the Jenkins integration is set up in QA Touch, map the Jenkins project to a QA Touch project and test run, select TestNG results and click Build Now in QA Touch. The blog notes JUnit results can be set up similarly.

Yes. The Selenium Java BDD guide syncs a Cucumber, JUnit and Selenium project. You put the test case code in the scenario name and set the project key and test run ID in Hooks.java.

Yes. The guides link sample repositories on GitHub for TestNG, Java BDD, the Java API sync files and the Jenkins example. They are listed in the setup section below.

Connect Selenium with QA Touch

Pick a route, add your test case codes and let your next Selenium run update the test run.