I've seen similar questions here but none seems to resolve the problem. I've the following code;
@Test(priority=2)
public void increaseQty(){
System.out.println("in increase qty");}
@Test(priority=2,dependsOnMethods={"increaseQty"})
public void decreaseQty(){
System.out.println("in decrease qty");}
@Test(priority=3)
public void removeFromCart() throws Exception{
System.out.println("remove qty");}
@Test(priority=3,dependsOnMethods={"removeFromCart"})
public void emptyCart() throws InterruptedException{
System.out.println("empty Cart");}
expected sequence of run is
increaseQty
decreaseQty
removeFromCart
emptyCart
but the actual sequence is
increaseQty
removeFromcart
decreaseQty
emptyCart
I am not able to understand why its not following the specified sequence. seems to me like its running independent methods first and then the dependent irrespective of the priority , but no such behavior is mentioned anywhere in the documentation. What should i do to make it run in desired sequence