首页 > 其他 > 详细

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

时间:2019-09-14 15:54:43      阅读:150      评论:0      收藏:0      [点我收藏+]

根据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.

技术分享图片

 

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

原文:https://www.cnblogs.com/54tester/p/11519151.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!