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 – running tests inside a suite in parallel

Perform the following steps for running tests inside a suite in parallel:

  1. Create a new class with the name SampleTestSuite under the test.parallelism package and replace the following code in it:
    package test.parallelism; import org.testng.annotations.AfterClass; import org.testng.annotations.AfterTest; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeTest; import org.testng.annotations.Parameters; import org.testng.annotations.Test; public class SampleTestSuite { String testName=""; @BeforeTest @Parameters({ "test-name" }) public void beforeTest(String testName){ this.testName=testName; long id = Thread.currentThread().getId(); System.out.println("Before 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