Categories

Dec 9, 2019 in Testing

Q: How to set test case priority in TestNG?

1 Answer

Dec 9, 2019
Below code helps you to understand how to set test case priority in TestNG.

1

2

3

4

5

6

7

8

9

10

11

12

13

package TestNG;

import org.testng.annotations.*;

public class SettingPriority {

@Test(priority=0)

public void method1() {

}

@Test(priority=1)

public void method2() {

}

@Test(priority=2)

public void method3() {

}

}

Test Execution Sequence:

1

2

3

Method1

Method2

Method3
Click here to read more about Loan/Mortgage
Click here to read more about Insurance

Related questions

Madanswer
May 18 in JUnit
May 18 in JUnit
Jun 30 in Python
...