Module 21 | Selenium Forum
M
Posted on 09/12/2015
Hi Ashish i am having problem with running the tests in Framework 21... when i run the tests, all test cases are skipped ..i have written the code in corrct order but did not see any mistake.. i am sending you my project file , kindly take a look and suggest me what to do.
Thank you

M
Replied on 09/12/2015

Hi Ashish , can you please assist me ASAP because i am stuck.
Thank you


M
Replied on 09/12/2015

there is a problem is in this code

[quote:3nun5j7s]
public static boolean isSuiteRunnable(String suiteName) {
Xls_Reader xls=new Xls_Reader(Constants.TESTSUITE_XLS_PATH);
int rows=xls.getRowCount(Constants.TESTSUITE_SHEET);
[color=#FF0000:3nun5j7s]for(int rNum=2;rNum<rows;rNum++)[/color:3nun5j7s]{
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);
[color=#FF0000:3nun5j7s]for(int rNum=2;rNum<rows;rNum++)[/color:3nun5j7s]{
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:3nun5j7s]


for loops are not executing and it returns false and then skips the test case.

try to change the value of rnum


M
Replied on 09/12/2015

Thank you for your Response, but i tried different values for the FOR LOOPs, and i am having the same problem. but when i comment the last function which is "validateTestExecution" , all tests are passed, don't you think there is a problem with this function?
please assist me with this problem
Thank you


M
Replied on 09/12/2015

[color=#FF0000:1ufh5wgn]int rows=xls.getRowCount(Constants.TESTSUITE_SHEET);
for(int rNum=2;rNum<rows;rNum++){
}
[/color:1ufh5wgn]

value of rows is 2 and rNum value is also 2 and condition you have put is [color=#FF0000:1ufh5wgn]row<rNum[/color:1ufh5wgn] so its not executing the for loop and both these function returning false.

so change for loop to for(int rNum=2;[color=#FF0000:1ufh5wgn]rNum<=rows[/color:1ufh5wgn];rNum++){}


M
Replied on 09/12/2015

Thank you very Ashish, i really appreciate your help.