Closed monica-adriana closed 8 years ago
By design, TestNG is creating tests then run tests.
To create tests, it uses DataProviders. Then it will run suites, tests, ...
You can try to define your data provider with Iterator<Object[]>
as return type. It may work.
An Iterator<Object[]>. The only difference with Object[][] is that an Iterator lets you create your test data lazily. TestNG will invoke the iterator and then the test method with the parameters returned by this iterator one by one. This is particularly useful if you have a lot of parameter sets to pass to the method and you don't want to create all of them upfront.
http://testng.org/doc/documentation-main.html#parameters-dataproviders
In case the BeforeSuite method trows an exception, DataProvider logic still gets executed. I would expect DataProvider methods to be skipped, same as test methods.