2.獲取表格中的資源id和操作方式數據主要方法如下:
public List<String> readXls(int rowNun)throw Exception{
String path="E:/新建 Microsoft Excel 97-2003 工作表.xls"
File file = new File(path);
InputStream is =new FileInputStream(
//默認第一個表格
HSSFSheet sheet = wb.getSheetAt(0);
HSSFRow row = sheet.getRow(rowNun);
int minColIx=row.getFirstCellNum();
int maxColIx=row.getLastCellNum();
List<String> result=new ArrayList<String>();
//過濾掉第一列和第二列數據
for(int collx=minColIx+2;collx<maxColIx;collx++){
HSSFCell cell=row.getCell(collx);
if(cell==null){
continue;
}
result.add(ExcelUtils.getStringVal(cell));
}
return result;
}
3.獲取到數據后供uiautomator定位控件方法調用,接下來我們對獲取的數據進行調用操作:
原文轉自:https://segmentfault.com/a/1190000007494058