-
Notifications
You must be signed in to change notification settings - Fork 1k
Open
Description
Currently, TestNG does not reliably combine @parameters (from XML) and @dataProvider in all contexts, especially when using:
- Multiple classes in or
- Parallel execution (thread-count > 1)
This causes Data provider mismatch errors even when the method signature and DataProvider are correct.
A suggested enhancement is for TestNG to consistently merge XML parameters with DataProvider values in all contexts, similar to how scanning works in simple cases.
Code used -
@Parameters("URI")
@Test(dataProvider ="getData")
public void testDemo(String url, String uname, String pass) {
System.out.println("Test Demo");
System.out.println(url);
System.out.println(uname + " " + pass);
}
@DataProvider
public Object[][] getData() {
Object[][] data = new Object [3] [2];
data [0][0] = "firstUser";
data [0][1] = "firstPass";
data [1][0] = "SecondUser";
data [1][1] = "SecondPass";
data [2][0] = "ThirdUser";
data [2][1] = "ThirdPass";
return data;
}Attached testng report & testng4.xml