I have two test cases TC1 and TC2 and trying to execute these two test cases three times in following manner: TC1 TC2 TC1 TC2 TC1 TC2
i tried with following code using @factory:
public class ClassName {@Test(priority = 1,invocationCount = 1)
// TC1
public void verifyQuestionTitle(){
try {
.....
}
catch(Exception e)
{
e.printStackTrace();
}
}
@Test(priority = 2,invocationCount = 1)
// TC2
public void verifyAnswerOptionsCount(){
try {
.....
}
catch(Exception e)
{
e.printStackTrace();
}
}
@Factory
public Object[] create(){
return new Object[]{
new ClassName (), new ClassName (), new ClassName ()
};
}
But this result in execution of TC1 three times first and then TC2 three times i.e. TC1 TC1 TC1 TC2 TC2 TC2 which is different than i desire. using the invocation count to 3 also result in same pattern. Can anyone help me achieving what i am looking for.
Aucun commentaire:
Enregistrer un commentaire