Module 19 ----Hybrid FrameWork | Selenium Forum
M
Posted on 01/03/2016
1... I want to know why does the name of the test case 'Check Items' is same as and sheet 'Check Items'. Do i need to implement this way in everyproject ? [For this question kindly see the attached snapshot].




2... And can you explain me the following code in very plain english ,means what is happening. This code in from Hybrid Framework Video 19. This code is written for Keyword iteration in the video.


for (currentTestDataSetID = 2; currentTestDataSetID <= currentTestSuiteXLS
.getRowCount(currentTestCaseName); currentTestDataSetID++) {

App_Logs.debug("Iteration Number "
+ (currentTestDataSetID - 1));
// Checking the run mode for current data set
if (currentTestSuiteXLS.getCellData(
currentTestCaseName, "Runmode",
currentTestDataSetID).equalsIgnoreCase("Y")) {

// Iterating through all keywords
for (currentTestStepID = 2; currentTestStepID <= currentTestSuiteXLS
.getRowCount("Test Steps"); currentTestStepID++) {
// Checking TCID
if (currentTestCaseName
.equals(currentTestSuiteXLS
.getCellData("Test Steps",
"TCID",
currentTestStepID))) {
currentKeyword = currentTestSuiteXLS
.getCellData("Test Steps",
"Keyword",
currentTestStepID);
App_Logs.debug(currentKeyword);
}
}

M
Replied on 03/03/2016

[quote:2nlnktc3]2... And can you explain me the following code in very plain english ,means what is happening. This code in from Hybrid Framework Video 19. This code is written for Keyword iteration in the video.
[/quote:2nlnktc3]

please watch the videos. we cannot explain everything that is covered in the videos.


M
Replied on 03/03/2016

[quote:1dl2x4dz]1... I want to know why does the name of the test case 'Check Items' is same as and sheet 'Check Items'. Do i need to implement this way in everyproject ? [For this question kindly see the attached snapshot].
[/quote:1dl2x4dz]

no you can change them


M
Replied on 03/03/2016

For Question 1.
Please correct me if I am wrong ,sir I manually on paper wrote the code and understood it . The sheet name is same as the test case name . I cannot keep the sheet name and the test name different because in the for loop i am passing currentTestCaseName and this is the dynamic coding so i cannot hard code ...
Am i Right ,Sir ?


M
Replied on 03/03/2016

[quote="Atul":22z5jrie]For Question 1.
Please correct me if I am wrong ,sir I manually on paper wrote the code and understood it . The sheet name is same as the test case name . I cannot keep the sheet name and the test name different because in the for loop i am passing currentTestCaseName and this is the dynamic coding so i cannot hard code ...
Am i Right ,Sir ?[/quote:22z5jrie]

yes, hard coding is bad practice and should be avoided. use same name and dynamic coding.