Hi Sobia, for running test cases in parallel we can use “parallel” attribute in testng.xml in TestNG. The parallel attribute of suite tag can accept four values:
tests – All the test cases inside <test> tag of testng.xml file will run parallel
classes – All the test cases inside a java class will run parallel
methods – All the methods with @Test annotation will execute parallel
instances – Test cases in same instance will execute parallel but two methods of two different instances will run in different thread.
<suite name="testingdemo" parallel="methods">