Wednesday, February 27, 2013

QTP :Schema of Framework by Actions

Schema of Framework by Operations performed by various Actions


1. Action 0
  •    excel open     //Action of test case given by QC
2. Calling_action
  •  Clean up 
  • Open Fresh app
  • Timer 

3. Start_execution
  • Create Time stamp folder
  • Create a duplicate Test_Data.xls file.
  • (In our case we will have our "local excel open" to be commented )   
  • Create QTP object -to grab the path of the Testcase name from the environment variable  and compare it with the name given as input ,this to avoid multiple excel use when test case has similar name in QC.
  • Traversing to find matching test case name in excel with that of env varible or check whether "execute " is YES.
  •  Extract the Keyword sheet.
  • Goto 2nd Sheet get the corresponding data of that keyword
  • Put the data in global sheet
  • Rest of the Actions are nothing but representation of modules of application.We use Select-Case inside a for loop to go to the particular action where actual execution takesplace. 
 Example:
Keyword_A---TestCase1
Keyword_B---TestCase2
Keyword_C---TestCase3
Keyword_D---TestCase4

For i=1 to end_of_excelsheet

if testcasename_Excel =Testcase_from_environment variable OR "yes" then
Grab_keyword=Corresponding_keyword_from_excel;
end if

Grab_Data=Corresponding_data of Grab_keyword in sheet2 of inputsheet;
global_sheet=grab_data;

Select Case grab_keyword
Case Keyword_A ,Keyword_C
goto action"gui_db";

Case Keyword_B ,Keyword_D
goto action"Some othe action";
end select
Next

---------------------------Action gui_db---------------------------
Option explicit
variables here

Select Case grab_keyword
Case Keyword_A
do these ;
reporter
set obj=nothing;
return pass or fail status to start execution
exitAction;

Case Keyword_C
do these;
reporter
set obj=nothing;
return pass or fail status to start execution
exitAction;
End select
--------------------------------------------------------------------------
To update status of the test case executed into the excel sheet.




No comments:

Post a Comment