Sunday 18 August 2013

Introduction of QTP Framework

Linear FW is the individual scripts written in QTP and executing the scripts individually.
Modualr FW is the collection of actions created as reusable in one test and calling these actions in the other test
Keyword Driven FW is creating functional libraries and calling funtion name as keywords in the test using default.xls data table.
Here is the reasons why we should use custom framework.
1) I created some of script using QTP built-in Object Repository on my PC’s C drive. Now
management decided that everyone should able to log into a network via Citrix server, OPEN
QTP there and execute different scripts. But, could not execute and I got error message
Action 1 not found. The reason all the script I have created into my PC on C drive. If I did not
have used QTP built-in Object Repository and have used custom framework then I could have
execute script from network.
2) You can start coding even when your application is not ready
Lets take the Login page as an example. The descriptions of the Login page will be
Code:
——————————————————————————–
Object Type Property Property Value
———– ——— —————
Browser title ScopePage name ScopeWebEdit name User IdWebEdit name PwdWebButton name Submit
——————————————————————————–
Based on the above descriptions you can create Dynamic Object Repository as below.
B=”title:=ABC”
P=”name:=XYZ”
Set BP=Browser(B).Page(P)
LO_UserId_WE=”name:=User Id”
LO_Pwd_WE=”name:=Pwd”
LO_Submit_WB=”name:=Submit”
The script could be:
BP.WebEdit(LO_UserId_WE).Set “Prashant”
BP.WebEdit(LO_Pwd_WE).Set “Patel”
BP.WebButton(LO_Submit_WB).Click
3) No need to keep same types of objects
For example: Page 1, Page 2, and Page 3 have Submit, Cancel and Reset buttons. When
QTP learns the objects it captures three objects for each page, totalling 9. However with
Dynamic Object Repository you have to declare only once, totalling 3.
4) You can make changes to Dynamic Object Repository without making a change to the script.
For example: If object property changed then script does not need to be changed.

No comments:

Post a Comment