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 – configuring a dependency test

Perform the following steps to configure a dependency test:

  1. Open the previously created Java project.
  2. Create a new class named DependencyTest under the test.sample package and add the following code to it:
    package test.sample; import org.testng.annotations.Test; public class DependencyTest { @Test(groups={"group-one"}) public void testMethodOne(){ System.out.println("Test method one of group-one"); } @Test(groups={"group-one"}) public void testMethodTwo(){ System.out.println("Test method two of group-one"); } @Test(groups={"group-one"}) public void testMethodThree(){ System.out.println("Test method three of group-one"); } @Test(groups={"group-two"}) public void testMethodFour(){ System.out.println("Test ...

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