I have a class with @Factory(dataProvider = "dp")
at constructor.
How can I obtain that class inside data provider?
class Test {
@Factory(dataProvider = "dp")
public Test(int i) {
//... some code
}
@DataProvider
public static Object[][] dp(ITestContext context, Method method) {
// need to get currently created class by factory
// method is null here
// not found any way to obtain this class from test context
}
}
In this example I can use hardcoded class name, but in real worl data provider is in parent class (or just separated class)