Recent Posts

LightBlog
Responsive Ads Here

Friday, September 14, 2018

How do I execute 100 test cases for a module in Selenium WebDriver?


By creating a suite Use test NG.
Include TestNG dataprovider in your test case so that you can execute n number poi test case using dataprovider.

Use Excel as your data source with test cases it will work like charm. Cheers!

Example:

@Test(dataprovider = “methodName”, dataproviderclass = Data.class)

Public void test(Parameters n…. ){

}

You can execute 100 test cases writing down all the relevant test cases for a module by creating a test case class for the various scenarios and to specify in which order you should execute set a priority for them .
Example - @Test (priority=0)
public void testLoginScenario_TC000(){ }

@Test (priority=1)
public void testLoginScenario_TC001(){ }
.
.
.
@Test (priority=99)
public void testLoginScenario_TC099(){ }

@Test (priority=100)
public void testLoginScenario_TC100(){ }
You can add invocationCount, If you wish to execute a single test case 100 times for it specifying its value set to 100
Example - @Test (invocationCount = 100)
public void testLoginScenario_TC001(){ }


No comments:

Post a Comment