//How to useTestNg annotations
import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class TestNgDemo {
@Test(priority=2)
public void test_2() {
System.out.println(“This is test case 2″);
}
@Test(priority=1)
public void test_3() {
System.out.println(“This is test case 3″);
Assert.assertEquals(“Hi”,”Hi”);
}
@BeforeMethod
public void setUp() {
System.out.println(“This iis precondition”);
}
}
public void test_2() {
System.out.println(“This is test case 2″);
}
@Test(priority=1)
public void test_3() {
System.out.println(“This is test case 3″);
Assert.assertEquals(“Hi”,”Hi”);
}
@BeforeMethod
public void setUp() {
System.out.println(“This iis precondition”);
}
}
No comments:
Post a Comment