selenium代码练习(testNG)
import org.testng.annotations.Test;
/*
* @Test:是注解的意思,代替了主函数,且可以有多个,一个@Test就相当于一条测试用例
* dependsOnMethods:依赖于某个方法
*/
public class TestNg1 {
@Test(description="这是一个输出helloworld的测试用例")
//description描述
public void test1(){
System.out.println("helloworld");
}
@Test(dependsOnMethods={"test1"})
//这个用例依赖于上面的test1
public void test2(){
System.out.println("123");
}
}