码迷,mamicode.com
首页 > 其他好文 > 详细

testng-dataprovider

时间:2019-05-02 15:54:12      阅读:141      评论:0      收藏:0      [点我收藏+]

标签:ide   testng   执行   ext   VID   实现   which   nbsp   call   

  • 基于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

标签:ide   testng   执行   ext   VID   实现   which   nbsp   call   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!