Include and Exclude Methods in TestNG

package testng;

import org.testng.annotations.Test;

public class IncludeandExclude 
	public void TestCase1()
		System.out.println("This is my 1st test case."+"\n");
	public void TestCase2()
		System.out.println("This is my 2nd test case."+"\n");
	public void TestCase3()
		System.out.println("This is my 3rd test case."+"\n");



<!DOCTYPE suite SYSTEM "" >
<suite name="Include and Exclude Test Suite" verbose="1" >
  <test name="Method Test Cases" >
       <class name="testng.IncludeandExclude">
        <include name="TestCase1" />
        <include name="TestCase2" />
        <exclude name="TestCase3" /> 


[TestNG] Running:

This is my 1st test case.

This is my 2nd test case.

Include and Exclude Test Suite
Total tests run: 2, Failures: 0, Skips: 0


Leave a Reply

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