QTP Testing Interview Questions and Answers

Even though QTP is an integral part of automated testing process, many of the QTP interview questions will include generic quality analyst questions too.

1. How do you invoke the Microsoft Internet Explorer browser in QTP?

The Internet Explorer browser can be invoked in QTP using the following:

SystemUtil.Run “iexplore”

2. What is the difference between QTP version 5.6 and version 8.2?

The 8.2 version of QTP has a few additional features that were not in the 6.5 version.   This includes the following:

  • Keyword View – Allows you to build and maintain tests (VBScripts not required).
  • Auto-Documentation – Provides the ability to view test steps in simple terms and enhanced test clarity.
  • Step Generator – Allows incremental steps through test scripts.

qtp interview questions

3. How can a script be modifies so that a new login name is required when a new test runs?

To accomplish this, the global data tables values can be parameterize.  This means that any number of rows that is entered into the data table will require QTP to execute the same number of new login names.

4. How can an action be added programmatically?

An Acton can be added programmatically by using the RunAction statement.  Before you can use this action command in the QTP Expert View, you must copy or call the action into your test.  The syntax for this command is RunAction Name, [IterationMode , IterationRange]. This is one of the Expert level QTP interview questions.

5. How can an external action be called?

This can be achieved by copying the Action X to Action Y.  In QTP 8.2 there is a menu option called insert- Copy of Action to help accomplish this.

6. What is source control?

Source control is used to hold all the builds of different versions.

7. Give examples of of Visual Basic functions can be used in QTP.

There are several VB functions that can be used in QTP.  Some are shown in the following list:

Asc, CBool, CByte, CCur, CDate, CDbl, Chr, CInt, CLng, CSng, CStr, Hex, Oct, etc.

Visual basic is one very important topic among QTP interview questions and a must asked one in interviews.

Senior QTP Interview Questions

8. How can error handling be implemented in QTP?

Error handling can be implemented in QTP using Recovery Manager,  For example, let’s say there is an edit box called Xname in PSWD.  While recording, type Xname and do not enter PSWD.  A message will appear that says, “Please enter PSWD.”  End the recording session and go to the Recovery Manager to locate the exception.

9. How can you repeat tasks in several QTP scripts?

This can be accomplished by splitting the action that is related to the task and make it Reusable.  Once this is done, the action can be called as many times as required.

10. Explain descriptive programming and its use.

Descriptive programming is used to classify objects that for whatever reason are not stored in the object repository. It can be implemented by constructing and using a description object.

11. How can a run-time parameter be added to a data sheet?

To add a run-time parameter to a data sheet, use the following command:

DataTable(“Column Name”,dtGlobalSheet/LocalSheet)=”Column Value”

However, you will only be able to see the parameter when the script is running and will not be available in the data table when the script is stopped.

12. How do you load a *.vbs file or a test generating script on a new machine?

In order to load a *.vbs file, you can include a File statement in the test script.

13. If an error occurs while a QTP script is running, how can you obtain the name of the object that caused the error?

To find the name of the object that caused the error, use the command  Err.description.  For example: msgbox “Error:”&err.description

Common QTP interview questions

14. How do you use QTP to fetch test data from a database?

In order to fetch test data from a database, an adobdb connection object must be connected to the database.  The syntax for this command is the following:


15. How can a java tree be handled in QTP?

To handle a java tree, you must first install a java add-in.  This can be found in the tools menu under the object identification drop-down listing.

16. What can be done if the shared object repository storage limit is exceeded?

If the 2MB limit of the shared object repository is exceeded, the advanced object repository editor can be used. This is a security level question being asked in QTP interview questions.

17. How many recording modes are in QTP and what are they?

There are 3 types of recording modes in QTP:

  • normal
  • analog
  • low level recording

18. What is the file extension of the QTP object repository and code file?

The file extension for object repository and code files is *.TSR. This is the most common QTP interview questions being asked.

19. How can you open a window in Notepad without recording a test without using the SystemUtil.Run command?

Another option to open Notepad is to use the ShellObject command. For example:

Set b = WScript.CreateObject (“WScript.shell”)b.run “notepad.exe”

20. What are the types of QTP actions?

There are 3 types of QTP actions:

  • Reuseable
  • Non-reusable
  • Nested

21. How can scripting be generated in QTP?

QTP has a built-in functionality called Step Generator which will generate scripts as you enter steps.  It is located in the Insert menu selection under Step. This is one of must QTP interview questions that is asked in all interviews.

22. What is the Object Repository Merge Utility?

The Object Repository Merge Utility allows testers to merge multiple object repository files into a single repository file.

Expert level QTP interview questions

23. How do you use drive data from an external spreadsheet?

To use data from an external spreadsheet, you must import it from a tabbed text file or an Excel spreadsheet file.  The data that you import will replace all of the data in the selected sheet of the table that is active.

24. How can dynamic run-time objects be handled in QTP?

Dynamic run-time objects can be handled using the GETRO property.

25. Is QTP capable of doing more than capture and playback?

Yes, in addition to capture and playback, QTP is also capable of descriptive programming.  Scripts can be created without the need to be recorded. Yes definitely QTP is more capable than that.  But this is a definite QTP interview questions you will face.

26. What exceptions can be handled using the QTP Recovery Scenario Manager?

Recovery Scenario Manager can be used with 4 types of trigger events.  They include the following:

  • When an open application fails
  • When the property of an object changes state or value
  • The appearance of a pop-up window in an open application during test execution
  • When a test step is unsuccessful
  • Exceptions and errors are a must prepared QTP interview questions before going for an interview.

27. Provide some features and benefits of QTP?

Some features and benefits of QTP are:

  • It can operate as a stand-alone tool
  • It can be  integrated into Quality Center
  • It can be integrated into Mercury Business Process Testing
  • It has Keyword Driven testing technology (zero-configuration”), which allows quicker test creation, great data-driven capability, and easier maintenance

28. Explain the Run-Time Data Table.

The Run-Time Data Table shows the data values that was used to during test execution and contains data Table parameters and output values.  And icon for this data table can be found in the test results tree display.

29. What scripting languages can you use with QTP?

QTP supports both Javascript and Visual Basic Script.

30. Can a Seibel application be tested using QTP?

Yes, QTP is capable of testing Seibel applications.  The following needs to be added to make this possible:

AutomationEnable = TRUE

SWECmd= AutoOn (in the URL)

31. How is exception handling done in QTP?

Recovery Scenario Manager is used for exception handling and it provides a wizard that guides you the tester through the recover scenario. It has the following sections:

  • Triggered events
  • Recovery steps
  • Post recovery test-run

32. What is an output value?

An output value is a value obtained during the testing session.  It is added to the run-time table and can be used as an input value in another part of testing.

Must know QTP interview questions

33. What properties can be used for identifying a page and browser when using descriptive programming?

Here are a few examples of how to identify a page and browser:

Logical Name of Browser

Logical Name of Page



34. Provide a challenge that can arise when using WinRunner?

This is an interview question that is used to check your experience.  Simply provide an example if you have experience with WinRunner.  For example, WinRunner may sometimes fail to identify a GUI object if it is a non-standard object or window.  GUI SPY can be used to handle such a situation.

35. Explain the QTP object repository types.

There are two object repository types in QTP: shared and per action (default).  Shared is used to call a particular action or an external library.  Per action repositories are used for one particular action. Object repository types is a confusing concept but one of the most commonly asked qtp interview questions.

36. How does QTP identify an object?

When in a recording mode, when QTP finds and object it stores it as test object.  QTP “learns” default (or mandatory) properties for each test object and checks to verify that there are enough properties present to identify each object as unique.

37. Explain the difference between copy action and call to action.

For a copy action, changes can be made to the copied action and they will not affect the original action.  A call to action on the other hand, can only be read in the calling test.

38. What is the difference between a per action repository and a shared repository?

Objects in shared repositories can be used in more than one action but in per action repositories, in every action, objects are stored separately and are not shared.

39. Provide an example using “createobject”.

Createobject is a command that creates and returns an automation object reference.  An example of it in use is the following:

Dim ExcelSheetSet ExcelSheet = CreateObject(“Excel.Sheet”)

40. Provide an example of where you can use a COM interface in a QTP project.

The COM interface is use in a scenario to connect the front end and back end.  For example, :if you are using Javascript as the front end and Oracle as the back end, then COM interfacing can improve the compatibility.

41. How can the text output value be used in QTP?

Text output values allow the tester to view the values that the application generates during run-time.  When they are parameterized, values change in each iteration. Creating output values will allow the tester to capture the values that the application takes for each run.  More Quick test pro questions. In this link you can also learn some more essential qtp interview questions.

If you have any more QTP Interview Questions that we missed, please write in the comments below.

Leave a Reply

Your email address will not be published.