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 – time test at suite level

  1. Open Eclipse and create a sample Java project with the structure shown in the following screenshot:
    Time for action – time test at suite level
  2. Add a sample test class with name TimeSuite and add the following code to it:
    package test.timetest;
    
    import org.testng.annotations.Test;
    
    public class TimeSuite {
      @Test
      public void timeTestOne() throws InterruptedException{
        Thread.sleep(1000);
        System.out.println("Time test method one");
      }
    
    @Test
      public void timeTestTwo() throws InterruptedException{
        Thread.sleep(400);
        System.out.println("Time test method two");
      }
    
    }

    The preceding test class contains two test methods which print a message onto to the console on ...

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