Home

Showing posts with label QTP. Show all posts
Showing posts with label QTP. Show all posts

Wednesday, August 15, 2012

QTP Challenge

Earlier, This blog post was supposed to explain how QTP identifies the objects but when, for curiosity, I typed in Google, I found 352 and more sites explaining the same. Some of them are so good that I didn’t find it useful to explain the same thing once again. It seems everybody knows how QTP identifies the objects. Still, if you have any concerned question, let me know by posting your questions in comment section.

So, when the initial idea was dropped, I thought to put a challenge on Object Identification by QTP. The challenge is very simple or at least it seems very simple but none of the QTP engineers I know could tell me the correct answer. This might be due to multiple reasons like:

  • They were too busy with their other daily work challenges
  • They didn’t find the challenge interesting enough
  • They didn’t want to spend time on something irrelevant of their daily work
  • They didn’t have tendency to explore about the new things
  • They didn’t have enough courage to take the challenges
  • etc. 

If anyone of you have one of the same reasons, this post is not for you. You can leave the post here and can continue working on something else. Rest of you, please continue with the challenge given below.

Challenge:

Their is a login page which have two fields: Login and Password. I have made some small changes in the code so that both objects have the same properties. Once, it is done I have added both these objects in the object repository and set the same properties for both of them. Now, the situation is:

  • Both of the objects have the same properties (except Logical Name which is not required for object identification)
  • Ordinal Identifier is set to none
  • Smart Identification is also disabled

Now, when I highlight, the QTP identifies the object correctly. The question here is how QTP is recognizing the objects correctly when every property of the two objects are same. Shouldn’t QTP display an error of existing of more than one object with same properties.

Download the Login Page and Object Repository for the reference.

Let me and others know if you have the answer or Please explore if you want to find out the answer yourself otherwise wait till someone post the correct answer. Please post your questions and answers as comments to this post.

(Credits to http://www.authpro.com/ for the login page)

Monday, June 11, 2012

Automation Architecture using QTP

For last few months, I have been working on QTP. In these months I have automated few applications with QTP and now I think the time has come to share my learning on QTP with others.  From now on, I will write the blog posts on QTP on regular basis.

Today, I am starting with Automation Architecture (framework) using QTP. Automation Architecture can be well understood by the following diagram:


AUT: AUT means “Application under Test” i.e. the application which is being automated in this case.

Object Repository: As name suggests it is repository of the objects from AUT. QTP recognizes the objects in the application through this object Repository. We will see how QTP recognizes the objects in the next blog post.

General User Library: General User Library aka “GUL” is the function library which has the common functions written in it. These functions can be used with any AUT.

Business User Library: Business User Library aka “BUL” is the function library which has Application specific functions.

Test Data: Test Data is the data required for testing. It could be anything like data table, excel, XML or CSV file.

Environment Variables: The global variables which are used by the Driver Script.

Recovery Scenarios: Recovery Scenarios are written to manage the unexpected error during execution.

Driver Scripts: This is main script which drives the automation. This is where the whole logic is written.

Test Execution Report: This report displays the script execution result either pass or fail.

I hope the above description will help you to understand the Automation Architecture using QTP. Let me know if there is any question on the same.
========================================================================================
Update on 12-06-2012: The title of the post and image is updated after getting the review from Lakshminarasimha M. and Sadhanandhan B. Thanks for their valuable feedback.