public static void main(String[] args) { KeyWordExecution exeKey = new KeyWordExecution(); ReadExcel excelSheet = new ReadExcel(); excelSheet.openSheet("H:/MyWork/testCaseSheet1.xlsx"); for (int row = 1; row < excelSheet.getRowCount(); row++) { List<Object> myParamList = new ArrayList<Object>(); String methodName = excelSheet.getValueFromCell(0, row); for (int col = 1; col < excelSheet.getColumnCount(); col++) { if (!excelSheet.getValueFromCell(col, row).isEmpty() & !excelSheet.getValueFromCell(col, row).equals("null")) { myParamList.add(excelSheet.getValueFromCell(col, row)); } } Object[] paramListObject = new String[myParamList.size()]; paramListObject = myParamList.toArray(paramListObject); exeKey.runReflectionMethod("com.keyword.sample.KeyWordExample", methodName, paramListObject); } }