Automation Frame Work
Automation Frame Work
Frame Work : Frame work is a Generic work designed by an expert and followed by many people to perfom
a particular task in an effective , efficient and optimized way.
1. Linear Frame work: This is a general and old frame work that can be used by many people.
Steps to follow ….
a). Generate the Basic Test
b). Enhance the test
c). Debug the test
d). Execute the test
e). Analyze the result
AUT
Login
Example : ………
……..
Tasks : Login Insert order
Insert order ………
Open existing order ……..
Logout Open order
Note : Here all the tasks are put together in one test pane and done the job
………
………
Put the tool under recoding mode Logout
Open flight application
Login with username and password
Click on OK
Insert an order by keying all the required info therein
Click on insert order button
That order will be inserted successfully. After inserting the order
Open existing order by clicking on open folder icon
A open order window will appear, check the order number check box
Input the existing order number ( say 9)
Click on OK
The order will open, if necessary you may update / delete the opened order
Logout will be done by going to menu bar of the application and select file , select
exit .
The application will close
Stop recording
Run the test
Analyze the result
2. Modular Frame work : This is also a general frame work that can be used by some people.
Steps to follow ….
a). Prepare the Individual Components for different tasks
b). Make the require Components as Re-Usable
c). Prepare the desired Driver based on end-to-end scenario
d). Execute the Driver
e). Analyze the results
Example :
Tasks : Login
Insert order
Open existing order
Logout
Note 1 : After preparing complete action, split it into different individual actions and call them in a driver.
Note 2 : Other words in this frame work, we are calling the action/s ( Ex. Call login )
AUT Driver
Login login insert open logout
……… Call login
……..
Insert order Login Insert order Open order Logout Call insert
……… ……… …….. ……. ………
…….. ……… …… …… ……… Call open
Open order
……… Call logout
………
Logout Components
Keep the cursor at the beginning of 1st line of existing 2nd part ( i.e starting of insert
order line)
Go to menu bar, click on Step , select Split Action
The split action window will appear
choose action type as independent of each other, give the 1st action name ( say
insert_order) and leave the 2nd action name as it is ( because, again we are going to
split the 2nd part )
Click OK
Save the changes. Next,
Keep the cursor at the beginning of 1st line of existing 2nd part ( i.e starting of open
order line)
Go to menu bar, click on Step , select Split Action
The split action window will appear
choose action type as independent of each other, give the 1st action name ( say
open_order) and give the 2nd action name as logout ( because, its end of splits )
Click OK
Save the changes.
So, we have splited all 4 tasks/actions successfully.
Now make them as re-usable components
Open the just created action i.e login from drop-down box on the tool
Go to menu bar , click on Step , select Action Properties
Action properties window will appear
Select General tab
Check the Reusable action check box
Click on OK
Do the same for other actions too i.e insert_order, open_order and logout. Next
Open new Test
Re-name the action as Driver , Go to menu bar , click on Step , select Action
Properties. Action properties window will appear ,Select General tab , change the
action name as Driver.
Click on OK
Here we can call any or all those re-usable actions
Go to menu bar, click on Insert, select Call to Existing Action
Select action window will appear ,
Browse the saved application ( i.e fl_application )
Select the one reusable action ( say login)
Select the Location option as After the current step
Click on OK
An existing action related to that login action will be added to this test
Do the same for other actions too i.e insert_order, open_order and logout.
Now the Driver script is ready for login, inserting the order , open the order and
logout.
Run the test
Analyze the results.
Note : in Driver test we can call any existing actions as we wish.
Batch Testing :
Batch testing is a process of executing a group of tests at a time.
To do the same QTP has provided a separate tool by name “Test Batch Runner” and we have to
configure the tool settings as below…..
QTP -> Tools -> Options -> Run -> Check Allow other mercury products to run tests and components.
Regression testing : Testing the functionalities of function and all its related functionalities at a time is
called Regression testing. Or it is the process of executing number of test a time.
Example : ??
3. Keyword Driven frame work: This is also a general frame work that can be used by most of people.
Steps to follow ….
1.First of all create the folder stricture as follows short form : TRL RET L
ProjectName_Automation
Script
Repository …………….
…………….
…… ………
Library ……………..
Recovery
L1
L2
Environment L4
Test
Test
Key word
Log
2. Create the required Test Data files and save them in the corresponding folder ( Test Data folder).
3. Create the required Shared Repository files and save them in corresponding folder ( Repository folder)
4. Create the required Library files and save them in corresponding folder ( Library folder)
5. Create the required Recovery files and save them in corresponding folder ( Recovery folder)
6. Create the required Environment files and save them in corresponding folder ( Environment folder)
7. Open the Main Test and associate all the Required resources like Test Data files, Repository files,
library files, recovery files and environment files.
8. Develop the script in such way that it executes based on the keyword given in the data table.
9. Save the Test in the corresponding folder ( Test folder)
10. Whenever require Open it and execute and analyze the results.
Example :
Tasks : Login
Insert order
Open existing order
Logout
Note : Here, after preparing complete action, split it into different individual Functions and call them in a Test.
Note 2 : Other words in this frame work, we are calling the Function/s ( Ex. Call login() )
AUT Test
Login login() insert() open() logout() Case “l1”
……… login()
…….. Case “l2”
Insert order Login Insert order Open order Logout insert()
……… ……… …….. ……. ……… Case “l3”
…….. ……… …… …… ……… open()
Open order Case “l4”
……… logout()
………
Logout Functions stored in Library folder
So, for above 4 tasks, we need to create 4 functions and store them in a library life
under library folder. For that …
Open a new notepad and write down the below script in it
Function login()
* Here, Paste the login code from Test script
End function
Function insert_order()
* Here, Paste the insert_order code from Test script
End function
Function open_order()
* Here, Paste the open_order code from Test script
End function
Function logout()
* Here, Paste the logout code from Test script
End function
Case "l4"
logout()
End Select
Note : System.run “path” is also can be used for invoke the application
4. Hybrid Frame work : Hybrid frame work is a mixer of two or more frame works.
* Library file is a collection of one or more functions
-: The End :-
Pls. leave your feed back (both +ve and –ve ) at [email protected]