Running test methods one after another in TestNG

前端 未结 3 1353
有刺的猬
有刺的猬 2021-01-23 05:44

I m using Eclipse + Selenium WebDriver + TestNG

This is my class structure :

class1
{
@test (invocation count =4)
method1()

@test (invocation count =4)
         


        
3条回答
  •  暖寄归人
    2021-01-23 06:17

    You can also use "priority" of TestNG as:

    @Test(priority = -19)
    public void testMethod1(){
    //some code
    }
    @Test(priority = -20)
    public void testMethod2(){
    //some code
    }
    

    [Note: The priority for this test method. Lower priorities will be scheduled first]

    So, in the above example testMethod2 will be executed first as -20 less than -19

    You can visit for more details: http://testng.org/doc/documentation-main.html#annotations

提交回复
热议问题