TestNG基础教程 - TestNG.xml中的测试级别和常用注解执行顺序

根据testng.xml 文件配置, 测试级别为suite -> test -> class -> methods.

test 对应testng.xml 中的test 标签, 而不是测试类里的@Test.

测试类里的@Test 对应 testng.xml中的methods.

 

创建TestCase 如TC3

运行效果

所以在使用@BeforeSuite,@BeforeTest,@BeforeClass,@BeforeMethod 等标签时,

它们的实际执行顺序也是suite -> test -> class -> method.

猜你喜欢

转载自www.cnblogs.com/54tester/p/11519151.html