您好我正在使用数据提供程序从selenium webdriver中使用混合框架从excel中获取数据,我想创建一个主测试套件文件来维护测试用例的运行模式,请帮我解决相同。
@DataProvider(name="hybridData")
public Object[][] getDatafromDataprovider() throws IOException
{
Object[][] object=null;
POIexcel file=new POIexcel();
XSSFSheet sheet=file.readexcel("Filepath", "File name ", "Sheet name ");
int rowcount=sheet.getLastRowNum()-sheet.getFirstRowNum();
System.out.println("row count is" +rowcount);
int col_count=sheet.getRow(1).getPhysicalNumberOfCells();
object=new Object[rowcount][col_count];
for(int i=0;i<rowcount;i++)
{
XSSFRow row=sheet.getRow(i+1);
for (int j = 0; j < row.getLastCellNum(); j++) {
//Print excel data in console
XSSFCell cell=row.getCell(j);
object[i][j] = cell.toString();
System.out.println("values are"+" " +object[i][j]);
}
}
return object;