public static boolean isSuiteRunnable(String suiteName) {
Xls_Reader xls=new Xls_Reader(Constants.TESTSUITE_XLS_PATH);
int rows=xls.getRowCount(Constants.TESTSUITE_SHEET);
for(int rNum=2;rNum<=rows;rNum++){
String testSuiteName=xls.getCellData(Constants.TESTSUITE_SHEET, Constants.SUITENAME_COL, rNum);
if(testSuiteName.toLowerCase().equals(suiteName.toLowerCase())){
String runMode=xls.getCellData(Constants.TESTSUITE_SHEET, Constants.RUNMODE_COL, rNum);
if(runMode.equals(Constants.RUNMODE_YES))
return true;
else
return false;
}
}
return false;
}
public static boolean isTestCaseRunnable(String testCaseName,Xls_Reader xls) {
int rows=xls.getColumnCount(Constants.TESTCASES_SHEET);
for(int rNum=2;rNum<=rows;rNum++){
String testName=xls.getCellData(Constants.TESTCASES_SHEET, Constants.TESTCASE_COL, rNum);
if(testName.toLowerCase().equals(testCaseName.toLowerCase())){
String runMode=xls.getCellData(Constants.TESTCASES_SHEET, Constants.RUNMODE_COL, rNum);
if(runMode.equals(Constants.RUNMODE_YES))
return true;
else
return false;
}
}
return false;
}
[quote="rkhan6310@gmail.com":fnzv2gok]public static boolean isSuiteRunnable(String suiteName) {
Xls_Reader xls=new Xls_Reader(Constants.TESTSUITE_XLS_PATH);
int [color=#FF0000:fnzv2gok]rows=xls.getRowCount(Constants.TESTSUITE_SHEET)[/color:fnzv2gok];
for(int [color=#FF0000:fnzv2gok]rNum=2[/color:fnzv2gok];rNum<=rows;rNum++){
String testSuiteName=xls.getCellData(Constants.TESTSUITE_SHEET, Constants.SUITENAME_COL, rNum);
if(testSuiteName.toLowerCase().equals(suiteName.toLowerCase())){
String runMode=xls.getCellData(Constants.TESTSUITE_SHEET, Constants.RUNMODE_COL, rNum);
if(runMode.equals(Constants.RUNMODE_YES))
return true;
else
return false;
}
}
return false;
}
public static boolean isTestCaseRunnable(String testCaseName,Xls_Reader xls) {
int [color=#FF0000:fnzv2gok]rows=xls.getColumnCount(Constants.TESTCASES_SHEET)[/color:fnzv2gok];
for(int [color=#FF0000:fnzv2gok]rNum=2[/color:fnzv2gok];rNum<=rows;rNum++){
String testName=xls.getCellData(Constants.TESTCASES_SHEET, Constants.TESTCASE_COL, rNum);
if(testName.toLowerCase().equals(testCaseName.toLowerCase())){
String runMode=xls.getCellData(Constants.TESTCASES_SHEET, Constants.RUNMODE_COL, rNum);
if(runMode.equals(Constants.RUNMODE_YES))
return true;
else
return false;
}
}
return false;
}[/quote:fnzv2gok]
for loops does not executes because [color=#FF0000:fnzv2gok]rNum>rows[/color:fnzv2gok] and it returns false.
please check the values or [color=#FF0000:fnzv2gok]rows and rNum [/color:fnzv2gok]. are those variable [color=#FF0000:fnzv2gok]rows [/color:fnzv2gok]picking values from xls sheet or not.
i tried it but same problem has accured , i am sending you the project please take a look , it might be problem with other code.
Thank you.
[quote:819i4d2h]public static boolean isTestCaseRunnable(String testCaseName,Xls_Reader xls) {
int [color=#FF0000:819i4d2h]rows=xls.getColumnCount(Constants.TESTCASES_SHEET);
[/color:819i4d2h]for(int rNum=2;rNum<=rows;rNum++){
String testName=xls.getCellData(Constants.TESTCASES_SHEET, Constants.TESTCASE_COL, rNum);
if(testName.toLowerCase().equals(testCaseName.toLowerCase())){
String runMode=xls.getCellData(Constants.TESTCASES_SHEET, Constants.RUNMODE_COL, rNum);
if(runMode.equals(Constants.RUNMODE_YES))
return true;
else
return false;
}
}
return false;
}
[/quote:819i4d2h]
you're getting column count get [color=#FF0000:819i4d2h]getRowCount(SheetName)[/color:819i4d2h]