O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – defining multigroup dependency in XML

  1. Create a new class named MultiGrpXmlDependency under the test.depends.xml package and replace the following code in it:
    package test.depends.xml;
    
    import org.testng.annotations.Test;
    
    public class MultiGrpXmlDependency {
      @Test(groups={"dependent-group"})
      public void groupTestOne(){
        System.out.println("Group Test method one");
      }
      
      @Test(groups={"test-group-one"})
      public void groupTestTwo(){
        System.out.println("Group test method two");
      }
      
      @Test(groups={"test-group-two"})
      public void groupTestThree(){
        System.out.println("Group Test method three");
      }
    }

    The preceding test class contains three test methods which print a message onto the console when executed. Each of the test methods belong to a different ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required