Check the results page
Result: the result page do not show the test parameters sent by dataprovider. See screenshot at: http://prntscr.com/ohyej5
The parameters do appear at testng-results.xml.
This issue happens only when Factory annotation is used together with dataprovider annotation. It does not happen when only dataprovider annonation is used by the test.
It is related to the following fixed issue: https://github.com/cbeust/testng/issues/1041
Test to reproduce issue
public class Test3 {
protected List<String> data;
@Factory (dataProvider = "getDataForInstances")
public Test3(List<String> dataToSet) {
this.data = dataToSet;
}
@Test
public void Sanity(){
String text = this.data.get(this.data.size()-1);
System.out.println("Printing Parameters when running test method [" + text + "]");
}
@DataProvider(name = "getDataForInstances")
public static Object[][] getDataForInstances( ITestNGMethod method) {
System.out.println("Method name = " + method.getConstructorOrMethod().getName() + "()\n");
return new Object[][] {
{Collections.singletonList("Java")},
{Arrays.asList("TestNG", "JUnit")},
{Arrays.asList("Maven", "Gradle", "Ant")}
};
}
}
Problem Statement
Test to reproduce issue
Operating System