Monday, 17 November 2014

How to useTestNg annotations


//How to useTestNg annotations


import org.testng.Assert;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
public class TestNgDemo {
@Test(priority=3)
public void test_1(){
System.out.println(“This is test case 1″);
}
@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”);
}
}

No comments:

Post a Comment