I am developing an automation testing code with the following error:
Type mismatch: cannot convert from CellType to int.
Please what can I do?
public static String cellToString(HSSFCell cell) {
// TODO Auto-generated method stub
int type;
Object result;
type = cell.getCellType();
switch (type) {
case 0 : // numeric value in Excel
result = cell.getNumericCellValue();
break;
case 1 : //String value in Excel
result = cell.getStringCellValue();
break;
default:
throw new RuntimeException("No support for this of cell");
}
return result.toString();
}