Wednesday, December 2, 2009

38. Explanation for the Keyword scripts:

ð First add the sheets in the Runtime Datatable.

Datatable.addsheet”Module”
Datatable.addsheet”Testcase”
Datatable.addsheet”Teststep”

ð Delete the Global Sheet and Action 1 Sheet.
Datatable.deletesheet(1)

ð Import the data from external excel sheet.
Datatable.importsheet” path of the excel sheet file”

ð Count number of rows in the module sheet.
Mod_rc=datatable.getsheet(1).getrowcount

ð Number of iterations.
For i=1 to mod_rc
Datatable.setcurrentrow(i)

ð To displaying number of rows in the mod_rc.
Msgbox mod_rc

ð Specifying the location of modexe value in 3rd column and first sheet.
Modexe=datatable.value(3,1)

ð If condition is true, module id will be stored in the modid.
If modexe=”Y” then
Modid=datatable(1,1)
(end of first sheet code)

ð Count number of rows in the test case sheet.
Tc_rc=datatable.getsheet(1).getrowcount

ð Number of iterations.
For j=1 to tc_rc
Datatable.setcurrentrow(j)

ð If condition is true, tcid will be stored in the tcid.
Tcmodid=datatable(5,2)
Tcexe=datatable(3,2)
If tcmodid=modid and tcexe=”Y” then
Tcid=datatable(1,2)
Msgbox tcid
(end of second sheet code)

ð Counting number of rows in the test steps sheet and storing number of rows in ts_rc variable.
Ts_rc=datatable.getsheet(3).getrowcount
Msgbox ts_rc
(displaying number of test steps)

ð Number of iterations.
For k=1 to ts_rc
Datatable.setcurrentrow(k)

ð Specifying the location of modexe value in 3rd column and first sheet.
Tstcid=datatable(5,3)

ð If condition is true keyword will be selected.
If tcid=tstcid then
Keyword=datatable(3,3)
(specifying the location of keyword)
Msgbox keyword

ð Selecting the keyword.
Select case keyword

ð Case is openapp it will call launchapp function.
Case “openapp”
Call launchapp(strur 1)

ð Case is adminlogin it will call adminlogin function.
Case”adminlogin”
Call adminlogin(str_uid,str_pwd)
Click to add text

ð Adminlogin function case “adminlogin” call
Admin (str_uid,str_pwd)
Click to add text

ð You add all the cases in the application.
And call respective functions.

No comments:

Post a Comment