-
Notifications
You must be signed in to change notification settings - Fork 0
/
TestNG5.java
38 lines (31 loc) · 871 Bytes
/
TestNG5.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package selenium;
import org.testng.SkipException;
import org.testng.annotations.Test;
public class TestNG5 {
//@Test
public void a() {
System.out.println("a test method");
}
//As Experience Professional, will use this
@Test(enabled = false) //always industry recommended
public void b() {
System.out.println("b test method");
}
//Test Case will Execute 2 times
@Test(invocationCount = 2)
public void c() {
System.out.println("c test method");
}
//Test Case will Execute 0 time, means wil skip
@Test(invocationCount = 0)
public void d() {
System.out.println("d test method");
}
//Correct way but not recommended
@Test
public void e() {
System.out.println("e test method");
throw new SkipException("skip e test method");
//System.out.println("Method Skipping"); // unreachable code
}
}