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 – using simple dependency in XML

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

    The preceding test class contains three test methods which print a message ...

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