我最初的要求是,我有两张 Excel 表
第一张表包含名字,姓氏第二张表包含公司,电子邮件
我必须合并两张表数据并将其传递给测试,在测试中它应该采取
第一组 .... 名字、姓氏、公司、电子邮件。第二组..名字,姓氏,公司,电子邮件..
直到数据存在于 excel 表中.. 这里的问题是在传递参数时我必须传递四个参数但在 excel 表中 2 参数...
需要帮助......
==================================================== =================================================
public Object[][] dataDetails() 抛出 BiffException, IOException{
String pathofExcel="D:\\Test-Excel3.xls";
String sheetName="test";
Generics gen=new Generics();
String employeeDetails[][]=gen.excelRead(pathofExcel, sheetName);
return employeeDetails;
}
public Object[][] dataDetails2() throws BiffException, IOException{
String pathofExcel="D:\\Test-Excel4.xls";
String sheetName="test";
Generics gen=new Generics();
String employeeDetailss[][]=gen.excelRead(pathofExcel, sheetName);
return employeeDetailss;
}
@DataProvider(name="enterformDetails")
public Object[][] dp() throws BiffException, IOException {
List<Object[]> result = Lists.newArrayList();
result.addAll(Arrays.asList(dataDetails()));
result.addAll(Arrays.asList(dataDetails2()));
return result.toArray(new Object[result.size()][]);
}
@Test(dataProvider="enterformDetails")
public void employDetails(String FName,String LastName,String Comp,String Email){
EmpDetails emp=new EmpDetails();
emp.enterDetails(FName, LastName, Comp,Email);
}
提前致谢..