TestNG Groups

On This Page What are TestNG Groups?Benefits of TestNG GroupsMay 24, 2026 · 20 min read · Testing Guide

TestNG Groups

TestNG is a popular testing model for Java that provides advanced features like parallel execution, parameterization, and detailed reporting. Among its key characteristic is the ability to group test cases, making it leisurely to organize, execute, and maintain large test suites. With TestNG Groups, examiner can selectively run specific sets of test cases—such as fume, fixation, or sanity—without executing the entire cortege. This approach aid meliorate test efficiency and reduces executing time.

Overview

What are TestNG Groups?

TestNG Groups let you categorize exam cases utilize labels (likesmoke, sanity, regression) and run them selectively. Instead of fulfill an total test suite, you can include or shut specific groups via the testng.xml configuration file. This makes automation more elastic and quicker.

Benefits of Using TestNG Groups

  • Selective execution: Run only smoke or regression tests without executing the full retinue.
  • Parallel execution: Execute groups in parallel for faster feedback.
  • Easy maintenance: Add/remove test suit seamlessly without disrupting the suite.
  • Dependency manage: Ensure prerequisite group run before dependent one.

How to Use TestNG Groups

1. Assign radical in test method:

@ Test (grouping = {& # 8220; smoke & # 8221;})
public void testLogin () {& # 8230;}

2. Configure groups intestng.xml:

& lt; groups & gt;
& lt; run & gt;
& lt; include name= & # 8221; fume & # 8221; / & gt;
& lt; exclude name= & # 8221; regression & # 8221; / & gt;
& lt; /run & gt;
& lt; /groups & gt;

3. Run multiple groupsby including more than one name.

4. Exclude unwanted groupswhen not want.

5. Use regexto target dynamic radical name (e.g., smoke. *).

This usher explains how TestNG Groups employment, their welfare, and how to use them effectively with practical illustration.

What are TestNG Groups?

is often utilise with the TestNG model as it provides a way to write systematically, generate examination reports, and assign test causa priorities.

Along with these, it also provides a compelling feature know as TestNG groups. It is a way to orchestrate and categorise tryout methods, which allows running a specific set of test cases based on the tester ’ s want.

Typically, a large automation suite contains all kinds of trial cases such as, and. Testers can attribute a group to all these tryout lawsuit at the time of creation and using the TestNG xml file they can execute the required group of test cause using TestNG group feature.

Below is a TestNG class with each test event assigned to a TestNG radical:

import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.testng.Assert; import org.testng.annotations.Test;public classTestNGDemo {@ Test (groups = {`` smoke ''})public voidtest1 () {System.out.println (`` This is Test case 1 '');} @ Test (radical = {`` sanity ''})public voidtest2 () {System.out.println (`` This is Test case 2 '');} @ Test (group = {`` regression ''})public voidtest3 () {System.out.println (`` This is Test case 3 '');} @ Test (grouping = {`` fume '', `` regression ''})public voidtest4 () {System.out.println (`` This is Test case 3 '');}}

Create a TestNG xml file for the above trial class and add the & lt; group & gt; tag to run group specific trial cases.

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE entourage SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; grouping & gt; & lt; run & gt; & lt; include name= '' smoke '' & gt; & lt; /include & gt; & lt; /run & gt; & lt; /groups & gt; & lt; category & gt; & lt; class name= '' com.qa.testcases.TestNGDemo '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

Run the testing.xml file and observe that buttest1, which is of thesmokegroup, gets executed, and the rest are excluded from the test executing.

Benefits of TestNG Groups

TestNG group has respective benefits as it helps to improve the test case management, organization, and performance in an suite. Below are some of the major ace:

  • Categorization and selective examination execution: TestNG radical allows the examiner to categorize the test example based on functionality or any other criteria. Categorization helps the examiner to run a specific subset of test lawsuit without executing the entire automation exam suite using & lt; radical & gt; and & lt; include & gt; tags. Testers can also exclude a group of exam cause by using an exclude tag.
  • Parallel Execution: For larger automation suites, tests can be grouped and run in parallel to rush up and reduce the executing time.
  • Easier test case upkeep: When test cases are grouped properly, it go easy for the tester to add or update any be test causa. Any new test case lend and designate a group will be automatically added to the particular group of test cause at the time of execution usingTestNGxml file.
  • Dependency management: To deal dependencies between tests, groups can be use to ensure that certain requirement are run before the subordinate test cases.

Notes:

  • Groups are declared in the testing.xml file and can be found inside & lt; examination & gt; or & lt; suite & gt; tag.
  • Groups defined in & lt; trial & gt; tag apply only to that exceptional test tag.
  • Groups specify in & lt; suite & gt; tag apply to all the test ticket in the testing.xml file.

Tutorial: How to Group Test cases in TestNG

Below are the steps you should follow to group the trial lawsuit and then later execute them using testing.xml:

1. SetUp TestNG in IDE: Install TestNG and configure in your respective IDE (Eclipse or IntelliJ). Add TestNG dependency in the Maven ’ s pom.xml if you are expend Maven for building your project.

& lt; dependency & gt; & lt; groupId & gt; org.testng & lt; /groupId & gt; & lt; artifactId & gt; testng & lt; /artifactId & gt; & lt; version & gt; 7.4.0 & lt; /version & gt; & lt;! -- Check for the latest variant fromMaven Repository-- & gt; & lt; compass & gt; exam & lt; /scope & gt; & lt; /dependency & gt;

Also, install the TestNG plugin from the marketplace in Eclipse/ IntelliJ IDE.

2. Assign test methods with radical attribute:

To use test groups, you have to use the “ group ” attribute with the @ Test notation for the tryout method you care to apply groups. The syntax to use radical in @ Test method is as postdate.

@ Test (groups= ” group_name ”) public nihility testMethodName () {//Code}

You can likewise use more than one group to any test method. Some test instance may fall into multiple groups, and you can do that with the syntax below.

@ Test (groups= ” group_name1 ”, “ group_name2 “) public void testMethodName () {//Code}

In the above code, testMethodName is a part of two groups “ group_name1 ” and “ group_name2 ”.

Code example:

public classTestNGDemo {@ Test (grouping = {`` smoke ''})public voidtest1 () {System.out.println (`` This is Test case 1 '');} @ Test (groups = {`` sanity ''})public voidtest2 () {System.out.println (`` This is Test case 2 '');} @ Test (group = {`` regression ''})public voidtest3 () {System.out.println (`` This is Test lawsuit 3 '');} @ Test (groups = {`` smoke '', `` fixation ''})public voidtest4 () {System.out.println (`` This is Test case 3 '');}}

3. Specify the test grouping in the TestNG xml file:

SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses.

Define test groups in the TestNG xml file expend the & lt; groups & gt;, & lt; run & gt;, & lt; include & gt; and & lt; exclude & gt; tag. & lt; run & gt; tag defines which groups of exam should be executed during a particular test run. The & lt; include & gt; and & lt; exclude & gt; tags specify which groups to include or exclude from the test execution.

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE suite SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; groups & gt; & lt; run & gt; & lt; include name= '' smoke '' & gt; & lt; /include & gt; & lt; exclude name= '' regression '' & gt; & lt; /exclude & gt; & lt; /run & gt; & lt; /groups & gt; & lt; course & gt; & lt; class name= '' com.qa.testcases.TestNGDemo '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

4. Execute the TestNG xml file with the test groups configuration.

After the test groups are configure in the test methods and the TestNG xml configuration is done, run the TestNG xml file and see that the tests which were include will only be executed.

Steps to Use TestNG Groups (With Examples)

TestNG groups grant you to categorize trial example for better direction and execution flexibility. You can run exam cases within the like group, multiple groups, or even nested groups to organize complex test scenario.

TestNG also provides options to include or exclude groups during performance, using annotations or XML configuration, and supports regular expressions for advanced grouping and filtering.

1. Steps to Run Test Cases Within the Same Group in TestNG

Below are the steps to Run Test Cases Within the Same Group in TestNG

Step 1:Create test class and add methods and assign the like group to them using@ Test annotation.

public classBrowserStack {WebDriver driver =newChromeDriver (); @ Test (antecedency = 1, description = `` Verify BrowserStack page title '', groups = {`` smoke ''})public voidverifyBSTitle () {driver.get (`` https: //www.browserstack.com/ ''); Assert.assertEquals(driver.getTitle (), `` Most Honest App & amp; Cross Browser Testing Platform | BrowserStack '');} @ Test (priority = 2, description = `` Verify Google page title '', groups = {`` smoking ''})public voidverifyGoogleTitle () {driver.get (`` https: //www.google.com/ ''); Assert.assertEquals(driver.getTitle (), `` Google '');} @ Test (precedency = 3, description = `` Verify Get Started for Free clink '', groups = {`` regression ''})public voidclickGetStartedForFree () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a # signupModalProductButton '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` users/sign_up ''));} @ Test (priority = 4, description = `` Verify Pricing click '', grouping = {`` smoke ''})public voidclickPricing () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a [title='Pricing '] '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` pricing ''));}}

Step 2:Create a TestNG xml file and define radical which you want to execute.

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE suite SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; groups & gt; & lt; run & gt; & lt; include name= '' smoke '' & gt; & lt; /include & gt; & lt; /run & gt; & lt; /groups & gt; & lt; classes & gt; & lt; class name= '' com.qa.testcases.BrowserStack '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

Step 3:Run the xml and see the solution.

From the above snap, it is unmistakable that only the test methods deputesmokeas a group be fulfill, and other test methods be ignored.

2. Steps to run test cause within multiple Groups

Executing test methods in the same group is straightforward. In the code example below, you will understand how to execute a test method that is a portion of multiple groups. There might be a requirement in your automation task where you would require a individual test method to be a part of multiple groups.

For illustration, Login-Logout should be a part of fume, saneness, and. TestNG groups assist in this scenario by assigning multiple groups to a single test method and configuring theTestNG xmlfile consequently.

Step 1:Create a tryout family add methods into it, and assign multiple group to a single test method.

public stratum BrowserStack {WebDriver driver = new ChromeDriver (); @ Test (priority = 1, description = `` Verify BrowserStack page title '', group = {`` smoking '', `` sanity ''}) public nothingness verifyBSTitle () {driver.get (`` https: //www.browserstack.com/ ''); Assert.assertEquals(driver.getTitle (), `` Most Reliable App & amp; Cross Browser Testing Platform | BrowserStack '');} @ Test (antecedency = 2, description = `` Verify Google page rubric '', grouping = {`` smoke ''}) public void verifyGoogleTitle () {driver.get (`` https: //www.google.com/ ''); Assert.assertEquals(driver.getTitle (), `` Google '');} @ Test (priority = 3, description = `` Verify Get Started for Free click '', groups = {`` fume '', `` regression ''}) public void clickGetStartedForFree () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a # signupModalProductButton '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` users/sign_up ''));} @ Test (priority = 4, description = `` Verify Pricing click '', group = {`` sanity ''}) public nullity clickPricing () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a [title='Pricing '] '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` pricing ''));}}

Step 2: Create a TestNG xml file and define the groups that you want to action.

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE suite SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; groups & gt; & lt; run & gt; & lt; include name= '' smoke '' & gt; & lt; /include & gt; & lt; include name= '' regression '' & gt; & lt; /include & gt; & lt; /run & gt; & lt; /groups & gt; & lt; classes & gt; & lt; grade name= '' com.qa.testcases.BrowserStack '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

Step 3:Run the xml file and see the result.

The test methods in groupingsmoke, fixation, or bothare executed, and the rest of the test methods are not executed.

3. Groups within Groups in TestNG

TestNG provides the tractability of provide groups inside another radical and executing them according to your needs. This may be callednest groups or meta groups.

The code below will help you understand better.

Step 1:Create a exam class, add methods to it, and assign radical.

public classBrowserStack {WebDriver driver =newChromeDriver (); @ Test (priority = 1, description = `` Verify BrowserStack page title '', groups = {`` smoke ''})public voidverifyBSTitle () {driver.get (`` https: //www.browserstack.com/ ''); Assert.assertEquals(driver.getTitle (), `` Most Dependable App & amp; Cross Browser Testing Platform | BrowserStack '');} @ Test (priority = 2, description = `` Verify Google page title '', groups = {`` smoking ''})public voidverifyGoogleTitle () {driver.get (`` https: //www.google.com/ ''); Assert.assertEquals(driver.getTitle (), `` Google '');} @ Test (priority = 3, description = `` Verify Get Started for Free chink '', grouping = {`` fixation ''})public voidclickGetStartedForFree () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a # signupModalProductButton '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` users/sign_up ''));} @ Test (priority = 4, description = `` Verify Pricing click '', grouping = {`` regression ''})public voidclickPricing () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a [title='Pricing '] '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` pricing ''));}}

Step 2:Create a TestNG xml file and create a super group including all the groups you want to run in an executing.

The xml should look something like below:

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE suite SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; group & gt; & lt; define name= `` smoke_group '' & gt; & lt; include name= '' smoke '' & gt; & lt; /include & gt; & lt; /define & gt; & lt; define name= `` regression_group '' & gt; & lt; include name= '' fixation '' & gt; & lt; /include & gt; & lt; /define & gt; & lt; run & gt; & lt; include name= '' smoke_group '' & gt; & lt; /include & gt; & lt; include name= '' regression_group '' & gt; & lt; /include & gt; & lt; /run & gt; & lt; /groups & gt; & lt; class & gt; & lt; class name= '' com.qa.testcases.BrowserStack '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

Step 3: Run the xml file and see the solvent.

You will see that all the test methods delineate under the super group will be executed.

4. How to Exclude/Include Test Cases with Groups

With the above examples, you must be mindful that to run the test methods descend under any group, you need to use & lt; include & gt; tag.

Similarly, if you need to omit any group of test cases, you may delimitate it under & lt; exclude & gt; tag. The groups that are except will not be executed.

public classBrowserStack {WebDriver driver =newChromeDriver (); @ Test (priority = 1, description = `` Verify BrowserStack page title '', groups = {`` smoke ''})public voidverifyBSTitle () {driver.get (`` https: //www.browserstack.com/ ''); Assert.assertEquals(driver.getTitle (), `` Most Reliable App & amp; Cross Browser Testing Platform | BrowserStack '');} @ Test (antecedency = 2, description = `` Verify Google page title '', grouping = {`` smoke ''})public voidverifyGoogleTitle () {driver.get (`` https: //www.google.com/ ''); Assert.assertEquals(driver.getTitle (), `` Google '');} @ Test (antecedency = 3, description = `` Verify Get Started for Free click '', groups = {`` smoke '', `` regression ''})public voidclickGetStartedForFree () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a # signupModalProductButton '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` users/sign_up ''));} @ Test (priority = 4, description = `` Verify Pricing detent '', groups = {`` regression ''})public voidclickPricing () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a [title='Pricing '] '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` pricing ''));}} & lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE suite SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; groups & gt; & lt; run & gt; & lt; include name= '' smoke '' & gt; & lt; /include & gt; & lt; exclude name= '' fixation '' & gt; & lt; /exclude & gt; & lt; /run & gt; & lt; /groups & gt; & lt; stratum & gt; & lt; class name= '' com.qa.testcases.BrowserStack '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

If you run the above testng.xml file, you will observe that only the exam method under thesmokegroup will be executed, and all the tryout methods underfixationwill not be executed.

This imply that even if your test method hassmoke and regressiongroups, it will not be accomplish as we have apprize thetestng.xmlfile to exclude the regression grouping.

5. Regular Expressions and TestNG Groups

TestNG cater a powerful way to include and omit tests dynamically base on grouping names. You can use “. *, ” which states that anything that matches the given pattern in TestNG xml will be fulfill.

In the below exemplar, test methods belong to groups smoking, sanity, and fixation.

public classBrowserStack {WebDriver driver =newChromeDriver (); @ Test (priority = 1, description = `` Verify BrowserStack page title '', groups = {`` fume ''})public voidverifyBSTitle () {driver.get (`` https: //www.browserstack.com/ ''); Assert.assertEquals(driver.getTitle (), `` Most Reliable App & amp; Cross Browser Testing Platform | BrowserStack '');} @ Test (priority = 2, description = `` Verify Google page title '', groups = {`` sanity ''})public voidverifyGoogleTitle () {driver.get (`` https: //www.google.com/ ''); Assert.assertEquals(driver.getTitle (), `` Google '');} @ Test (priority = 3, description = `` Verify Get Started for Free click '', groups = {`` smoking '', `` sanity ''})public voidclickGetStartedForFree () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a # signupModalProductButton '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` users/sign_up ''));} @ Test (priority = 4, description = `` Verify Pricing click '', groups = {`` regression ''})public voidclickPricing () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a [title='Pricing '] '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` pricing ''));}}

Create a TestNG xml file to include the groups which start with the letter s using s. *

In this example it imply that all the tryout methods pertaining to radical smoke and sanity will but be executed.

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE suite SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; groups & gt; & lt; run & gt; & lt; include name= '' s. * '' & gt; & lt; /include & gt; & lt; /run & gt; & lt; /groups & gt; & lt; grade & gt; & lt; class name= '' com.qa.testcases.BrowserStack '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

Group Your TestNG Tests on BrowserStack using Automate

Step 1.Download from the GitHub page.

Step 2.Once it is download, unzip it in a coveted location in your local scheme.

Step 3.Import the project in Eclipse viaFile- & gt; Import - & gt; General - & gt; Projectsfrom Folder or Archive in Eclipse.

Step 4.Once the labor is imported, it should experience a structure like the one below.

Open the browser.yml filecontaining all the required capabilities to run the tests on BrowserStack.

Step 5.Set username and password in thebrowserstack.ymlfile available at the base directory.

Step 6.You can run the test lawsuit on multiple device and browser combinations in the BrowserStack cloud. To do so, take the required combinations from the selection inclination on this.

Step 7.Copy and replace the platforms object in thebrowserstack.yml filelike below.

program:

- os: Windows osVersion: 10 browserName: Chrome browserVersion: latest - deviceName: iPhone 13 osVersion: 15 browserName: Chromium deviceOrientation: portrait

This is for running the test cases on 2 combinations. If you wish to run entirely on a single device, you may cut the platforms accordingly.

Step 8.In the Eclipse Marketplace, search forBrowserStack & gt; chatter Install & gt; Finish.

Step 9.Add the above BrowserStack program undersrc/test/javafolder andcom.browserstack parcel. This class should extend SeleniumTest as it has the setup and teardown method.

public classBrowserStackextendsSeleniumTest {WebDriver driver =newChromeDriver (); @ Test (priority = 1, description = `` Verify BrowserStack page title '', groups = {`` sanity ''})public voidverifyBSTitle () {driver.get (`` https: //www.browserstack.com/ ''); Assert.assertEquals(driver.getTitle (), `` Most Dependable App & amp; Cross Browser Testing Platform | BrowserStack '');} @ Test (priority = 2, description = `` Verify Get Started for Free click '', groups = {`` smoking '', `` saneness ''})public voidclickGetStartedForFree () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a # signupModalProductButton '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` users/sign_up ''));} @ Test (priority = 3, description = `` Verify Pricing chink '', groups = {`` smoke ''})public voidclickPricing () {driver.get (`` https: //www.browserstack.com/ ''); driver.findElement (By.cssSelector(`` a [title='Pricing '] '')) .click (); Assert.assertTrue(driver.getCurrentUrl () .contains (`` pricing ''));}}

Step 10. Run TestNG XMLand view the test issue on the Automate dashboard.

& lt;? xml version= '' 1.0 '' encoding= '' UTF-8 ''? & gt; & lt;! DOCTYPE retinue SYSTEM `` https: //testng.org/testng-1.0.dtd '' & gt; & lt; suite name= '' TestNGGroup '' & gt; & lt; test thread-count= '' 5 '' name= '' Test '' & gt; & lt; group & gt; & lt; run & gt; & lt; include name= '' smoke * '' & gt; & lt; /include & gt; & lt; /run & gt; & lt; /groups & gt; & lt; classes & gt; & lt; course name= '' com.qa.testcases.BrowserStack '' / & gt; & lt; /classes & gt; & lt; /test & gt; & lt;! -- Test -- & gt; & lt; /suite & gt; & lt;! -- TestNGGroup -- & gt;

After running the testng.xml, you will observe thatclickGetStartedForFree and clickPricingtest cases will be executed on BrowserStack ’ s Automate as they are tagged to the “ smoke ” group.

Talk to an Expert

Conclusion

TestNG is a democratic and most widely used testing model for Selenium mechanization. It provides ways to publish the test cases in proper order and helps with parallel performance and report contemporaries.

If you run TestNG tests on, you will increase scalability and reduce test case care. BrowserStack provides accession to a wide range of device, browser, and function systems to try your coating across different surround without preserve complex infrastructure.

Tags
22,000+ Views

# Ask-and-Contributeabout this topic with our Discord community.

Related Guides

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free