How to Set Test Case Priority in TestNG

1
140

How to set test case priority in TestNG?

Setting Priority in TestNG

[java] //Code Snippet

package TestNG;

import org.testng.annotations.*;

public class SettingPriority {

// m1 , m2 and m3 are three methods

@Test(priority=0)

public void m1() {

}

@Test(priority=1)

public void m2() {

}

@Test(priority=2)

public void m3() {

}

}

[/java]

Test Execution Sequence:
1. m1

2. m2

3. m3

Facebook Comments

1 COMMENT

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.