testng-dataprovider
- 基于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.