I have many methods in my class , when i run the code ,methods are called randomly , but in my class ,every method depends on its predeccessor ,ie 2nd method depends on the 1st method , 3rd method depends on the 2nd method and so on .I want to exectue all the methods sequentially
I have tried the below metods and tested the code ,but still the methods are called randomly
//using sequential
@Test(sequential = true)
public void Method1(){
}
@Test(sequential = true)
public void Method2(){
}
//using singleThreaded
@Test(singleThreaded=true)
public void Method1(){
}
@Test(singleThreaded=true)
public void Method2(){
}
I have passed the following parameter in the testng as well
<test name="Test" preserve-order="true" annotations="JDK">
<classes>
<class name="com.test" >
<methods>
<include name="method1"/>
<include name="method2"/>
<include name="method3"/>...
</methods>
</class>
</classes>
</test>
</suite>
When I tested it with @Test(dependsOnMethod="")
,instead of executing the methods sequentially, the methods are getting skipped.
How to execute the test sequentially in testng?