Use Grouping in TestNG – Selenium Webdriver

package testng;

import org.testng.annotations.Test;

public class Grouping 
	@Test (groups={"regression"})
	public void testcase1()
		System.out.println("It's Test case 1 and in regression group" +"\n");
	@Test (groups={"unit"})
	public void testcase2()
		System.out.println("It's Test case 2 and in unit group" +"\n");
	@Test (groups={"regression"})
	public void testcase3()
		System.out.println("It's Test case 3 and in regression group" +"\n");



<?xml version="1.0" encoding="UTF-8"?>
<suite name="Grouping Test Case Suite">
  <test name="grouping">
  	<define name = "all">
  		<include name="regression"/>
  		<exclude name="unit"/>
        <include name="all"/>
       <class name="testng.Grouping" />


Leave a Reply

Your email address will not be published. Required fields are marked *