首页 > 其他 > 详细

testng-dataprovider

时间:2019-05-02 15:56:46      阅读:135      评论:0      收藏:0      [点我收藏+]
  • 基于ITestContext实现dataprovider的时候,直接在ran as testng一直提示失败,获取groups的长度竟然是0,头大技术分享图片
  • 原来基于ITestContext的时候,是要用testng.xml文件来实现的,那就加一个xml文件技术分享图片

  • 可是按上图执行,groups2获取到的dataprovider 还是groups1的,原来要分开,每一个groups一个test
  • 这样才行
  • 技术分享图片

     

 别人给的解释:If you directly run your testng class, it will first call dataprovider which cant get groups information as groups are not available. But instead if you call this class via testng.xml, it will have groups info available with ITestContext.

testng-dataprovider

原文:https://www.cnblogs.com/shilimaixiang/p/10802404.html

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