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
domainandapi-token. - Keep your frameworkTestNG, or Cucumber with JUnit, stays as it is. Jenkins can do the sync for you.
Selenium WebDriver
- Java TestNG
- Cucumber BDD + JUnit
- Jenkins builds
domain + api-token
QA Touch test run
- Result per test case
- Status updated after execution
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.
QAtouchAPIClient.javadomain + API tokenMatch 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);
}Hooks.javaproject key + test run IDQAtouchAPIClient.javadomain + API tokenMatch 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 pageMatch 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
Keep the TestNG suite, add one line
- Does
- Sets
run_result_tc_idin each test and runs it from the IDE. - Sees
- The execution log, then the updated result in the test run.
Name scenarios with the case code
- Does
- Writes
TC0001_Google Searchstyle scenario names in the feature file. - Sees
- Each scenario’s result on its QA Touch test case.
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.
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.
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 seleniumTestngFrameworkCreate a test run
In QA Touch open your project and create a test run for the automation execution.
Add the test case code
Take the code from QA Touch (e.g. TC0001) into your test:
run_result_tc_idin TestNG, the scenario name in BDD.Generate your API key
User → Edit profile → General settings → Generate API Key.
Open the test run config
Get your domain, project key and test run ID from the test run config popup.
Set the API token and domain
Edit
QAtouchAPIClient.java(undersrc/test;apicucumber/src/testin the BDD sample).Set project key and test run ID
In
GoogleTest.javafor TestNG, orHooks.javafor BDD.Run the test
Use Run in your IDE, or Run Scenario for a feature file.
Check the test run
Open the test run in QA Touch. The result is updated.
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.
What do I need before I start?
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.
Where do I get the 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.
How does QA Touch know which test case a result belongs to?
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.
Can Jenkins sync Selenium results without custom API code?
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.
Does it work with Cucumber BDD?
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.
Are there sample projects?
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.