Thursday, 20 November 2014

How QTP Works

Let consider your friend hang-ups in an official call and you need to pickup his Client from an airport on behalf of him. Pause here and think yourself what are the question you will ask to your friend to identify his Client.
1. What is his name?
2. What is his approximate height?
3. What is his complexion? and so on…
So what are all these name, height and complexion? These are the properties you filtered to identify his Client. Please note his Client might have lot of other properties too like his weight, dress etc., however our object is to filter the properties which we need to identify the object. Your friend is giving the information and you are storing it everything in your mind. When you reach the airport, you are comparing each person in the airport with the properties you stored in your mind. To which person it’s exactly matching you will bring that person.

How QTP Works ?

QTP uses this same technique. Object Spy is the tool which will give the information about the objects. You will filter few properties which are needed to identify the object and store in the utility called Object Repository. When you run your test QTP will compare the object properties stored in the Object Repository with the object available in the application and perform the action on the matching object.

Runtime Object and Test Object in QTP

Objects stored in the Object Repository or in short OR are called as Test Objects and the objects available in the application under test are called as Run Time Objects.
Take a Login Page with two textboxes User Name and Password and one Button Submit. When recording QTP will Identify the object User Name and Password as WebEdit (which is called as Class Name of the Object) and stores it as a Test Object along with any properties to identify the object in future. Name, HTML ID, X, Y, etc. are few properties of WebEdit Class. Similarly Submit will be identified as WebButton. Now we have three Objects in Object Repository, when running the test QTP will compare these Objects with the Objects in the AUT and perform the action on the Object.

Class vs Object

Don’t get confused between a Class and an Object. In the first example, Client is the Object belongs to Human Class. Similarly User Name is an Object belongs to WebEdit Class and Submit is an Object belongs to WebButton Class.

No comments:

Post a Comment

QTP/UFT Tutorials © 2014. All Rights Reserved | Powered by-Blogger | Designed by-Dapinder