UFT Interview Questions

Q1. What is UFT?

HP Unified Functional Testing (UFT) software, formerly known as HP QuickTest Professional (QTP) provides functional and regression test automation for software applications and environments. HP Unified Functional Testing can be used for enterprise quality assurance.

HP Unified Functional Testing supports keyword and scripting interfaces and features a graphical user interface. It uses the Visual Basic Scripting Edition (VBScript) scripting language to specify a test procedure, and to manipulate the objects and controls of the application under test.

N.B. In all of the Questions and answer below Quick Test Professional (QTP) stands for Unified Functional Testing (UFT)

Q2. What is the latest version of UFT available in the market?

Unified Functional Testing 12.01

Q3. What is Environment Variable in QTP and why to use it?

Environment variables are global variables in QTP and they are used to store the global values like User Id, password of the APP.

For More Software QA Tutorials and Interview preparations please visit: www.tonmoyelearn.com

Q4. What phases are involved in testing an application in QTP?

The Quick Test Professional process consists of the following main phases:

  • Analyzing Application: before preparing test cases need to analyze the application to find out the testing needs.
  • Preparing Testing Infrastructure: based on testing needs create those resources, resources like, shared repository, function library etc.
  • Building Test Cases: create test script containing action to be performed while testing. Add object repository with the test function libraries.
  • Enhancing Test: by making use of checkpoints, broadening the scope of test, add logic and condition to test for checking purpose.
  • Debugging, Running and analyzing Test: debug the test so that it works without interruption. Run these test and analyze the test result generated by QTP
  • Report Defects: lock bug into the bug report and send it to the development team.

Q5. How many types of recording modes in the QTP?

The QTP enable us with three type of recording mode:

  • Normal (by Default recording): In this recording mode QTP identify the object irrespective of their location on the screen. It is done by recording object based on application window.
  • Analog Recording: it is used when exact mouse movement and action performed by mouse is important. Used in testing the paint application and signature made with the help of mouse.
  • Low Level Recording: it helps in identifying those objects which is not recognized by the QTP. It is used when the location of object is changing inside the screen.

Q6. What is object repository?

Object Repository: when QTP learn any object from application it stores those object in the Object Repository with the properties of the object. It is used to identify the object. There are two types of object repository:

  • Shared Object Repository: It can be shared between multiple tests but it does not allow making changes in the repository. Mostly used in Keyword Driven methodology. It is saved with .TSR extension.
  • Local Object Repository: This type of object repository is linked with only one test. In this we can perform change in the repository, like changing the properties of the object, adding object in the repository. It is saved with .MTR extension.

Q7. Explain step generator in QTP?

Step Generator in QTP helps in creating those steps which is performed over the object while testing. Use of Step Generator in QTP:

  • Help in debugging the script by making use of Break.
  • To add those step which we forget to perform while recording.
  • To ensure that objects exist in the repository
  • To add up step in the function library.
  • For More Software QA Tutorials and Interview preparations please visit: www.tonmoyelearn.com

Q8. Explain the use of Action Split in QTP?

Action Split: it is used to split the action into two parts. There are two type of split an action:

  • Splitting into two sibling action: both split actions are independent of each other.
  • Splitting into Parent-Child nested action: in this second split action is only called after the execution of the parent split action. Child split action depends upon the parent split action.

QTP generated the duplicate copy of the object repository when we perform Split action. We can add object to anyone spilt action which is not added into another split action’s repository.

Q9. What is the purpose of loading QTP Add-Ins?

Add-Ins: are small programs or files which can be added to computer in order to enhance the capabilities of the system. The purposes of loading Add-Ins into QTP are following:

  • To increase capabilities of the system.
  • To improve the graphics quality, communications interface.
  • To load the particular function into the memory.
  • To excess only those functions that is required for the execution of the script.

Q10. What is a data driven test in QTP?

Data Driven is an automation testing part in which test input or output values, these values are read from data files. It is performed when the values are changing by the time. The different data files may include data pools. The data is then loaded into variables in recorded or manually coded scripts. In QTP to perform the data to drive the test, we use the parameterization process. When we do data-driven test, we perform two extra steps:

  • Converting the test to a data-driven test.
  • Creating a corresponding data table.

Q11. How to use Parameterization in QTP?

It is the process of making use of different values in place of recorded values which is replaced by variable which contains different values that can be used during the execution of the scripts. QTP enable us with different type of Parameterization, passing of data:

  • Using Loop statement.
  • Dynamically test data submission
  • Using data table.
  • Fetching data from external files.
  • Fetching data from databases.
  • By taking test data front end(GUI)

Q12. Is it possible to call from one action to another action in QTP?

Yes, QTP enable us to call from one action to another action. There are two ways of calling action:

  • Call to Copy of action: in this we generate the copy of action in our repository which enables us to perform change to the copy of action.
  • Call to Existing action: we call to action which is made up earlier. This generates the reference to the action. We can access the action in read only mode. In this no copy of existing script and data table is made.

Q13. Explain different types of action in QTP?

When generating the test script, it includes only one action. Action contains the number of steps to be performed on application to test the application. There are three type of action in QTP:

  • Non-Reusable action: it can be called by test only once in which it is stored.
  • Reusable action: it can be called by test multiple times in which it is stored.
  • External action: it is reusable action but stored in external test. We can call external action but it will be available in read only mode we cannot perform any change to the External Action.

Q14. What is difference between Run time object and Test object?

The difference between Run time Object and Test object are:

  • Run time object are actual object in the application whereas test object are reference of the actual object.
  • Run time object always have same name whereas test object name varies in different environment.
  • Test object are used to identify the actual object in the application which is run time objects.
  • Run time object resides in the application whereas test object resides in the object repository.

Q15. Explain Measuring Transaction.

Measuring transaction means that to measure how much time it take to execute a set of step over the application. A transaction is collection of steps that we are intended to know how much time it take to execute. We can define the transaction by enclosing the set of steps with the start transaction and end transaction.

  • Start transaction: after encounter of start transaction time measurement start.
  • End transaction: it is used to stop the time measurement.

Q16. Explain different checkpoints in QTP.

Checkpoint is a point where QTP current value or property of the object with the expected value or property of the object. When we insert the check point in the test, then in keyword view checkpoint is added in front of current row and in expert view a checkpoint statement is added. QTP enable us with following types of check point:

  • Standard Checkpoint: check properties of objects like button, combo boxes, list etc.
  • Image Checkpoint: check value of an image
  • Bitmap Checkpoint: check image zooming capability.
  • Table Checkpoint: check information of a table.
  • Text Checkpoint: check text is displayed on correct place.
  • Text Area Checkpoint: check text is displayed in specific area.
  • Accessibility Checkpoint: used to determine website which is not as per W3C guidelines.
  • Page Checkpoint: checks properties of the webpage.
  • Database Checkpoint: check content of database
  • XML Checkpoint: check XML content.

Q17. Can we create a QTP test from QC?

Yes we can create QTP test from QC but we must first make sure QTP has the ability to execute tests from Quality Center. Please ensure the following option in QTP Run Settings is enabled:

When QTP is enabled, follow the below steps to schedule and execute tests from Quality Center:

  1. Login to Quality Center and Navigate to Test Lab Module
    After selecting the correct Test Set, Click the Execution Flow Tab.
    3. Right-click on the test that requires configuration of Time Dependency and click Test Run Schedule.
    4. In the Run Schedule window, select the Time Dependency tab. The time and date of execution can be configured.

5. Time dependency will be added to the relevant test.
6. After time dependency has been added, navigate back to the Execution Grid pane. From the Execution Grid, select the tests to be run at the designated date and time.
7. From the Automatic Runner dialog, click Run All.
8. Once Run All is clicked from the Automatic Runner dialog, the test status will change to Waiting and QC will fire the tests to be run at the scheduled date and time:
9. QC will fire the tests in the sequence configured in the Execution Flow pane. The Test Run Scheduler will show all the tests that were selected and are executing and are to be executed.

Q18. Explain the concepts of Test Fusion Report of QTP.

Test Fusion report displays different aspects of the test run, soon after the tester has run a test. A high-level results overview, and expandable Tree View of the test, test data used, the screen shots of the application for every step which highlights discrepancies if at all and each check point pass a failure’s deep explanation; are the aspects. The combination of Test Fusion reports and Quick Test Pro, the reports can be shared across an entire Quality Assurance and the development team.

Q19. How does Run time data (Parameterization) is handled in QTP?

The parameter feature can be utilized in Quick Test Pro for enhancing the test or component by using parameterization. A variable acts as a parameter which is assigned a value through an external source or generator. In different steps or check points, the values can be parameterized in test component. The action parameters values can also be parameterized. A data driven wizard could be used to parameterize the same value in several steps.

Q20. Explain the QTP Tool interface.

The QTP Tool interface has certain key elements:

– Title bar – displays the name of the open test

– Menu bar – displays menus of Quick Test Pro commands

– File tool bar – has buttons for assisting in managing tests

– Test tool bar – has buttons used while creating and maintaining tests

– Debug tool bar – has buttons used during debugging tests – it can be viewed by clicking View->Toolbars->Debug.

– Action Toolbar – has buttons and several actions which enables the tester to view the individual action details or even the entire flow of the test. It can be displayed by clicking View->Toolbars->Action.

– Test pane – has 2 tabs for viewing the test; Tree view and Expert View

– Test details pane – has the Active Screen

– Data table – has Global and Action tabs for assisting in parameterizing the test.

– Debug Viewer pane – has three tabs for assisting in debugging the tests

– Status bar – displays the status of the test.

-Results Viewer – To display the results of last test run

Q21.Explain how QTP recognizes Objects in AUT.

Object is any GUI element the user interacts with. As the user is testing the application, QTP records and stores each item the user interacts with. This is stored in an object repository. Each entry has a logical name and some properties to uniquely identify. Any reference of an object in the script is identified by the logical name. Each line in the quick test script has a reference to the object the user interacted with, a call to the method and parameter if any.

Explain the types of Object Repositories in QTP.

Local Object Repository – As the Name Suggests, the Object Repository is applicable only for that Action. As we know that QTP creates a New Test with 1 action by default. Local Object Repository can be opened by traversing to Resources -> Object Repository. This is the default Object Repository in QTP.

Shared Object Repository – The Object Repository is Shared across actions/modules which would be mapped for two or more actions. Local objects can be exported to be saved into Shared Object Repository by using the option “Export Local Objects” Options. Shared Object Repository can be opened by traversing to Resource -> Object Repository Manager

Below are the major differences between Local and Shared Object Repository:

Local Object Repository(LOR) Shared Object Repository (SOR)
This Object Repository is available one for each action. This type of OR is available for multiple tests and for multiple actions.
This is the OR that is available for each tests by default. This type of OR is usually used in frameworks considering reusuability and maintainability.
Local Object Repository is Editable in Object Repository. Shared Object Respository is read only by default but can be edited in Object Repository Manager.
It is NOT a standalone file that can edited. SOR is a standalone file that can be edited easily.
It is Saved with an Extension .bdb SOR is saved with an extension .tsr
It Should be used when not many tests are working on the same screens of the application under test. SOR Should be used when there are different scripts interacting with the same type of the object.


Q22.Explain the check points in QTP.

The conditions within the script are checked by using various check points. They are similar to control structures like if, if…else, for, while etc. The results are updated based on the check points. Checkpoints in QTP allow the tester to verify if the functionalities deliver results as expected. Checkpoints can be inserted into a test or a test component and acts a verification point that compares the specified value of a property with its most recent value.

QTP supports 7 types of check points.

  1. Standard Check point
  2. Text Check point
  3. Text Area Check point
  4. Bit Map Check point
  5. Accessibility Check Point
  6. Data Base Check point
  7. XML Check Point

Q23. What is Parameterizing Tests?

Parameterizing tests is referred as replacement of fixed values with parameters, when converting the test into data driven tests.

In QTP, in order to test the same operation with different values, parameters can be passed. When parameters are sepcifed, the fixed values of the test are replaced by the parameters.

Q24. What is the default object synchronization timeout in QTP?

The default object synchronization in QTP is 20 seconds.

Q25. How to check which add-ins are associated with a test in QTP?

To see which add ins are associated with the test in QTP, you have to open the test settings in QTP and then select properties of test. There you will find the list of add-ins that are associated with the test.

Q26. How to find the path of folder in which test is saved in QTP?

To get the path of the test you can access built-in environment variable called “TestDir”

Q27. How to find the name of machine where you are running your automation scripts in QTP?

To get the name of machine, you can access built-in environment variable called “LocalHostName”

Q28. Difference between Image check-point and Bit map check point.

A bit map check point need not have image and it goes by the screen area. Whereas in image check-point, an image is needed.

Bitmap check point can compare the exact means of the source images with the destination images. It compares the exact image between both builds. Parts of images can also be checked. Where as in image check point, all the values and properties of the image can be checked.

Q29. What is the extension of Recovery Scenario file in QTP?

Recovery Scenarios in QTP are saved in file with extension .qrs which stands for quicktest recovery scenario. In one qrs file you can have multiple scenarios defined in it.


Q30. What is the extension of shared object repository in QTP?

Shared object repository in QTP is stored in .tsr file. You create .tsr file using export option in local repository. To edit .tsr file you have to open .tsr file in object repository manager and then modify it.


Q31. How to associate shared object repository to test in QTP?

To associate shared object repository you have to go to Resources->Associate Repositories option and then choose and select the .tsr file and associate it with particular or all actions in test.

Q32. How to merge 2 shared object repositories in QTP?

To merge 2 shared object repositories in QTP, you have to open object repository manager tool and then select merge tool in Tools menu.

Q33. What is the use of object spy tool in QTP?

QTP provides one tool called object spy that can be used to find out the properties and the values of the object in QTP.

Q34. How to find the length of string in QTP?

You can find the length of the string using one vb script function called len.

Suppose you want to find the length of “salunke” then you will have the below statement which will print the length of string .

print len(“salunke”)


Q35. How to find the current system time in QTP?

You can find the current system time using Time function in vbscript.

Print time

Q36. How to Comment a line in QTP script?

You can comment the line using rem or ‘.

‘ this line is commented.

rem this line is also commented.


Q37. What is the difference between QTP and Selenium?

QTP is not open source tool while Selenium is open source tool.

We can use QTP to test different kinds of applications like web, .net, java, mainframe, peoplesoft etc.

But Selenium is used only for Web application testing. QTP supports only vb script as language but we can develop selenium scripts using JAVA, .Net, Ruby, Perl etc.


Q38. How to remove all spaces from given string in QTP?

We can use replace function in vbscript to remove all spaces in string.

e.g. newstring = replace(stringwithspaces,” “,””)

Q39. How to find the modulus of a number in QTP?

We can find the modulus of given number using MOD operator.

a = 10 mod 5

print a


Q40. How to find the length of array in QTP?

To find the length of array, we can use ubound function in QTP.

print ubound(arr) – ‘prints upper bound of array.


Q41. What is difference between byref and byval in QTP?

You can pass the parameters to function or procedure using byref or byval method.

byref will pass the address of variable but byval will pass the copy of variable. So when you want the passed value to change, you can pass the value using byref method. Otherwise you can pass it using byval method.

Q42. How to find the difference between 2 dates in QTP?

You can find the difference between 2 dates using datediff function. You can get the difference in terms of minutes, seconds, hours, months or years.


Q43. How to check if given variable is scalar or array in QTP?

You can use Isarray function to check if variable is array or not.

abc = IsArray(varToTest)

If varToTest is array variable, abc will contain true else false.

Q44. What are advantages of test automation?

Time – It produces quick results

No Manual intervention

Cost effective

Not prone to human errors

Q45. If the objects hierarchy is changing from build to build, then how you will handle that condition?


In this case descriptive programming can be used instead of having an OR. Even while descriptive programming try to use regular expressions to identify the unique property of the objects.


Q46. I have developed and executed a script successfully, and saved the same to QC. When I tried to execute the script from QC, the script is not executing. What are the possible reasons?

1) Firstly, QuickTest Add-In for Quality Center has to be installed.

2) In the QTP Tools > Options >run tab you should have ‘Allow other Mercury products to run tests and components’ selected.

3) Make sure you are running QTP as an Admin

4) All the test resources have to be in the correct path


Q47. What is the extension of QTP local Repository? If it is .mtr then what is .bdb extension stands for?

.bdb is the local OR. .mtr is a binary file that contains other information about checkpoints and all. To re-verify the .bdb is the OR, try to rename the file with the extension as .tsr and open it from ORM. The same objects in the OR will be displayed here. The same will not work if you try it on .mtr file.

Q48. What is virtual object?


A virtual object is a non-standard object that is instructed by the tester via QTP to behave like a standard one.

Q49. How do you capture tool tip using QTP?

Tool Tip capture method varies depending on the type of object this tool tip appears for. It could be for links, images or any other web elements.

For web elements use: Object.title property.

For image: Image(“some name”).GetROProperty(“alt”)…..etc.


Q50. How can you close the second opened browser?


You can know which browser instance was opened after another can be known by using the “creation time” property. In simple terms, this is nothing but a counter for each browser instance that gets launched. For the first one, it is 0 and gets incremented from then on. To close the second opened browser, you can use the following code:



Q51. How do know the number of browsers opened?


To do this you will have to check how many child objects of the type ‘browser’ are present on the desktop. The following is the code that explains it:


Set ObjectBrowser = Description.Create

ObjectBrowser(“micclass”).Value = “Browser”

Set BObj = Desktop.ChildObjects(ObjectBrowser)

Msgbox Obj.Count


Q52. What is synchronization point in QTP?


It is a feature that QTP provides to make your test wait until a certain property on a certain object becomes an expected value before proceeding with the next steps.

Q53. What is reusable action?


An action that can be called multiple times within or outside the same test is called reusable action. By default all actions are reusable.


Q54. Why do we use breakpoints in QTP?


This is to stop the execution of your test at a certain point while its running. Typically it is used to observe the state of your application or to understand how a certain feature works at a certain phase at runtime. (The checking is of course a manual step.)


Q55. What is throw object?


VB Script does not have any specific throw object. (At least to the best of my knowledge) This question will not come up unless a specific add-in that supports this feature is explored.

Q56. How do you know the location Id of an object if you know its index id?


Location is the position of the object from left to right and top to bottom within the parent window, frame, or dialog box relative to other similar objects.


Index Id: is the order in which the object appears in your AUT relative to other similar objects. E.g if you have 2 links, then index id=0 will be first link and index id=1 will be the second link.


The answer to this question is entirely dependent on where the object lies, whether it is within the same parent or not.


Q57. What test cases you can automate using QTP?


As an automation enthusiast I would say, you can automate anything. It is only limited by your imagination and expertise. However, in case you need to understand the look, feel or human reaction to a certain feature, then that is not possible. This is the case with any tool, not specific to QTP.

Q58. How to handle Java tree in QTP?


You will need to select and load the Java Add-in. Then you can record and work on a Java Tree object just like you would with any other object.


Q59. How to give call to another action from one action?


Calling one action from the other can be done by “Inserting a call” to an existing action or by creating a new action.


Q60. How to find Operating system information using QTP script?

You can do that with the help of environment variable. The exact variable is, OS and OSVersion is for the version information.

Q61. How you can identify browser and its information using QTP script?


You can identify and act on any browser that you opened again by referring to its ‘creationtime’ property and use it like you would with a browser object in your OR.


Q62. How are actions and functions different in QTP?


Actions have their own Datatables and OR, but functions don’t. More importantly, Functions are a VB Scripting element, not only applicable to QTP. Please refer article 21 a detailed explanation of these.

Q63. Explain how to use QTP to check broken links on a page?

Page checkpoint. You can incorporate this page checkpoint on every page to check for broken links. To do so, you can go to Tools->options->Web->Advanced and choosing the option to check for broken links automatically on every page QTP accesses.

Q64. Can we run multiple QTP scripts one after the other without manual intervention? How?

Yes. To do so, you will have to create a batch file using the batch runner tool.

Q65. Explain process of smart Identification in QTP

If the recorded description does not enable QTP to identify the specified object in a step, and a smart identification definition is defined (and enabled) for the object, QTP tries to identify the object using “Smart identification”.

Q66. When to use shared and local object repository?


The decision is completely up to you. Shared OR will make more sense when you have multiple scripts referring to the same objects.


Q67. What are the advantages of Object Repository?

OR is an inbuilt feature provided by QTP to store your test objects. There are many advantages and the most important one is that it is a mandatory element unless you are going for descriptive programming.

Q68. In Hybrid framework, data can accessed through database, excel file, XML etc. Is it true?

Yes. Any of the mentioned data sources are permissible.

Q69. How to associate function library at run time?


  1. You can do so by using the “LoadFunctionLibrary” method. LoadFunctionLibrary “Completepath”
  2. You can also use the ExecuteFile method. ExecuteFile “Completepath”

Q70. Hybrid framework can be implemented for any application. Is it true?


Q71. Hybrid framework supports Descriptive programming. Is it true?

Yes. Frameworks are mostly based on how and where you want your test assets to be placed and how they are to be accessed for maximum efficiency. They do not restrict how you write you test itself.


Q72. What are the advantages of Hybrid framework?

Hybrid framework is nothing but a combination of frameworks that make you arrive at a solution for your testing needs by taking what works best for your scenario. The obvious advantage is the versatility. It can be tailored to meet any testing project’s need.


Q73. What is Procedure or Subroutine in VB Script?


Sub procedure is a series of VB Script statements (enclosed by Sub and End Sub statements) that perform actions but don’t return a value. A Sub procedure can take arguments (constants, variables, or expressions that are passed by a calling procedure). If a Sub procedure has no arguments, its Sub statement must include an empty set of parentheses ().


Q73. Is VB Script Case sensitive or Case insensitive?


It is not case sensitive with respect to command and variable names. Everything else, like strings (text) is.

Q74. How to record application running on Virtual machine?


You can access and record QTP script as long as the application is available to you via a browser and not by using remote connecting software.


Q75. What are the factors on which script execution time is dependent?


  1. Network and computer speeds. The response time from the app, the database etc. This is true even if you are manually executing the test.
  2. It also depends on the wait statements you have included.
  3. Not loading the add-ins that your test does not use helps too.
  4. Descriptive programming steps take longer than regular ones to execute
  5. Capturing screenshots at run time through QTP also consumes time
  6. Disabling smart identification also speeds up the QTP script running time

Q76. What is Test Fusion Report in QTP?


Test Fusion report as the name indicates is a detailed test results that QTP provides in a tree format. It has all the iteration information, data used for each of them along with the standard information.


Q77. Both Static and dynamic arrays are handled by VB script. Is it true?


Yes. A static array is declared as Dim A(10). This means it’s an array of 11 items. If the tester needs to modify it to contain 20 items he can do so by using ‘redim’.


redim A(19). There is a “Preserve” statement that can be used in conjunction with the redim statement. When preserve is used all the previous values are not erased.

Q78. What is the difference between keyword view and expert view?

They are two ways QTP shows your test. Each one has their own features and caters to users of different levels of expertise.

Keyword view: This is a tabular representation of your test that has the information like the Item, Operation,Data and Comments.

Expert view: This displays your test in terms of the actual lines of code. It is more like a VB Script editor and is used by advanced users.

Q79. In website, protocol has been changed http: to https what you will do? Tell me your approach?

Since the protocol change does not necessarily affect the UI change, except may be for a warning message about certificates, there are not many changes. All you need to do is provide the new URL and make sure you handle the security related pop-ups.