TestNG: invocation count and threadCount

We might need to run a particular test for multiple times for retesting and also leverage parallel test with Test method.
It can also be used to load test.

//invocationCount: repeats the test for the specified numbers of time
// threadPoolSize : Will run in multiple thread pool for parallel test or
//Load test

	@Test(invocationCount = 3, threadPoolSize = 2, timeOut = 10000)
	public static void Test1() {
		System.out.println("I am in Test1 and this is invocation test. Thread Id:" + Thread.currentThread().getId()
				+ " Current Time:" + LocalTime.now());
	}

Leave a Reply