问题:-尝试在不同的测试方法中使用数据提供程序。以下代码的错误消息是:-数据提供者正在尝试传递 6 个参数,但方法 testcases.useDataProvider#Login 需要 2
代码:-
public class useDataProvider {
@DataProvider (name="dp1")
public Object[][] getData(){
//Code for reading from excel
//Returning 6 Strings
return data;
}
@Test(dataProvider="dp1")
public void Login(String username, String password) {
System.out.println("The User is:-"+username);
System.out.println("The Password is:-"+password);
}
@Test(dataProvider="dp1", dependsOnMethods = { "Login" })
public void testCase(String q1, String a1, String q2, String a2) {
System.out.println("The Security Q1 is:-"+q1);
System.out.println("The Security A1 is:-"+a1);
System.out.println("The Security Q2 is:-"+q2);
System.out.println("The Security A2 is:-"+a2);
}
}