QTP Interview Questions and Answers with Useful Interview Tips

Below are some useful tips to prepare for QTP interview, followed by the most common QTP interview questions and answers. Actually, we had planned this post at the end of our QTP training article series. But many readers requested to provide interview questions so that you can prepare for the interview while learning QTP.

Listed here part 1 and part 2 links for your convenience:

=> QTP Interview Questions Part 1

=> QTP Interview Questions Part 2

Note – In this post, we have covered some useful tips to prepare for QTP interview along with top 20 common and crucial Quick Test Professional questions and answers. Please provide more questions in comments and we’ll update this post with answers to your questions. You can also post your questions using this “Share Your QTP Interview Questions” page.

We devised a list of pre-requisites or non-technical aspects that every QTP interviewee has to be familiar with.

Here are some useful tips to prepare for QTP interview:

The most common but crucial questions that are asked in the QTP interview. The best part of these questions is that you have time to prepare an answer in advance before even the interview begins.

  1. What are the reasons for choosing to automate your project and why did you choose QTP?
  2. What is the most challenging testing situation you faced and how did you overcome it?
  3. Did QTP prove efficient for your project? Yes, or No, explain?
  4. How did you achieve reusability via QTP?
  5. Did you find anything in your project that QTP proved inefficient to perform?
  6. Under what conditions would you recommend QTP for future projects?

We suggest you spend some time with these questions and come up with answers based on your practical experience from using QTP in your respective projects.

Another important question that your interviewer would be interested to know is the statistics. For example:

  1. How many scripts did you have?
  2. How often were they executed?
  3. How many lines of code in each script?
  4. Did you use function libraries and/or shared ORs?
  5. How long to develop a script?
  6. Did the scripts need a lot of maintenance? If yes, why?

Again, be sure to be prepared with the answers to these questions.

The last piece of advice, be honest and straightforward. Keep in mind that not all projects are same and not everybody follows the same methods. So we recommend that you have a clear understanding of your project and exhibit the potential to learn. Nobody expects you to know everything; they only expect you to know what you do best.

Let’s move on to the technical QTP questions.

QTP Interview Questions and Answered

Top 20 Most Asked QuickTest Professional Interview Questions

1) Different types of QTP test assets and their extensions:

2) Technologies supported by QTP:

Web, Java (Core and Advanced),.Net, WPF, SAP, Oracle, Siebel, PeopleSoft, Delphi, Power Builder, Stingray 1, Terminal Emulator, Flex, Web Services, Windows Mobile, VisualAge Smalltalk, Silverlight and mainframe terminal emulator

3) Does QTP run in any environment?

No, QTP works only in the windows environment.

4) Explain the views in the QTP GUI?

Keyword view: This view is a tabular representation of all the objects and the actions that are performed on them. Every row in the table is a step performed on the AUT and can be modified. Some of the most common columns displayed are item, operation, value and documentation.

Expert view: As the name indicates, this view is for more technical users who would want to tweak the source code as per their requirements.

5) What is QTP’s model for test creation?

a) Determine testing needs – Define testing environment, Analyse your application and plan actions

b) Set up repositories – Local or Shared OR

c) Define function libraries

d) Generate test steps – Add steps, Add checkpoints

e) Data drive your tests

f) Run the tests

6) What are the different kinds of test steps?

5 types of steps:

– Test Object ( Performs actions on a TO)

– Functions

– Utility (Steps to control run session. Eg: Reporter.report)

– Comment

– Programming logic (Loop, conditions…etc)

7) What are the different ways to invoke an application using QTP?

a) SystemUtil.Run

SystemUtil.Run ( FileName, Parameters, Path, Operation )

Example: SystemUtil.Run(“iexplorer.exe”,http://www.google.com)

SystemUtil.Run(“test.txt”, “”,”C:\”,”1”)

b) InvokeApplication

Example: InvokeApplication “C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.google.com”

c) Creating a shell object using VB Script

Example: Create a “WScript.shell” object.

Dim testshell

Set testshell= CreateObject (“Wscript.shell”)

testshell.run “%windir%\notepad “

8) What are the different recording modes and how do they work?

QTP provides 3 modes of recording:

9) Which recording modes need more memory?

Analog and Low-level recording modes

10) Is it possible to switch between recording modes during a test creation?

Yes, in the middle of recording, we can switch to Analog/Low-level mode, finish the task required and go back to normal recording. The switch to Analog mode is available only during recording and not during editing

11) Does Low-level recording capture mouse movements?

No. Mouse movements are not captured.

12) How does QTP identify an object?

QTP has a predetermined set of properties that it learns/stores for every class of object it identifies. There are 3 aspects to this:

13) What is Smart identification?

If the recorded description does not enable QTP to identify a specific object then QTP uses “Smart identification” mechanism.  It uses the following additional properties to identify the object

a) Base Filter Properties (primary) – The set of properties that cannot be changed without changing the object type

b) Optional Filter Properties (secondary) – additional properties that help identify the object uniquely.

14) What is Object Spy?

Object Spy is an extremely helpful tool that QTP has to view the properties and operations of an object in the AUT. It shows all the properties of the object and the corresponding values. It also shows the object hierarchy. It also has a provision that lets the users add a certain object to the OR.

15) What is an object repository?

OR is like a warehouse where all the objects in a test are stored. OR has the list of Objects that QTP learned during the recording process and the class to which they belong. It stores the set of properties that uniquely identify the Object (description) and also names the object for the sake of identification in our test, based on its most prominent feature.

16) What are the two types of repositories available, explain them?

Local and shared repository – these are the two kinds of available repositories.

Every action by default has a local repository of its own and has all the objects that are used within it.

Alternately, the tester can have a common repository for multiple actions so that all of them can share the objects that it contains. The common repository is called a shared OR.

17) An action has both shared and local OR associated with it and both have the same object in them. In the test which one will be considered?

If a local OR and Shared OR have an object with the same name, the action will consider the object in its local OR.

18) Can an action have 2 shared object repositories associated with them? In that case, if two of them contain the same object, which one will be considered?

There can be more than one Shared OR’s associated with the same action. If Shared OR1 and Shared OR2 have one object named OBJ1 each and if the action calls for OBJ1 then the order in which the shared ORs were associated will be considered. That means, if Shared OR1 was first associated then the OBJ1 from Shared OR1 will be taken into account.

19) Can the user toggle between using Local OR and shared OR for the same action?

Yes, it is possible to switch between one or the other types of ORs at any time. To do so, the menu option is Test->Settings->Resources and choosing the options accordingly.

20) Are Shared ORs read-only?

By default, shared ORs open as read-only. To open them in order to edit them you will have to open them from Object Repository Manager.

“ORM->File->Enable Editing”

More QTP Interview QuestionHere is an old post for more QTP interview questions.

Over to you:

Interested in seeing more QTP questions? We are going to do more follow up QTP questions. Please post your questions on the above article and also let us know of any other QTP related questions that you would like to be answered.