TestSuite处理测试用例有6个规约(否则会被拒绝执行测试) A 测试用例必须是公有类(Public) B 测试用例必须继承与TestCase类 C 测试用例的测试方法必须是公有的( Public ) D 测试用例的测试方法必须被声明为Void E 测试用例中测试方法的前置名词必须是test F 测试用例中测试方法误任何传递参数 执行TestNg有几种方式:命令行.Eclipse/IntelliJ.ant等.第一种: 直接执行,右键要执行的方法,点Run As ->TestNG Test第二…
有必要介绍一下TestNG注解的生命周期,先看一下官网支持的注解有 @BeforeSuite@AfterSuite@BeforeTest@AfterTest@BeforeGroups@AfterGroups@BeforeClass@AfterClass@BeforeMethod@AfterMethod Configuration information for a TestNG class: @BeforeSuite: The annotated method will be run befor…