Below are some useful tips to prepare for HP (now Micro Focus) QTP/UFT interview, followed by the most common QTP/UFT 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 to prepare for the interview while learning QTP.
Note – In this post, we have covered some useful tips to prepare for the QTP interview along with the top 80 common and crucial Quick Test Professional questions and answers.
We devised a list of pre-requisites or non-technical aspects that every QTP interviewee has to be familiar with.
What You Will Learn:
Useful Tips To Prepare For QTP/UFT Interview
- QTP is merely a tool that facilitates testing. The ultimate goal of QTP- or any other testing tool for that matter- is efficient and effective testing. So, make sure your testing fundamentals are solid.
- Next undeniably is the knowledge about the QTP tool. Make sure you know all the basic information about the tool.
- QTP predominantly relies on a tester’s programming skills to design, develop and maintain tests. That does not mean knowing all the features of the tool or VB Script are enough. The most important skill the automation tester should have is the ability of the logic building. QTP tool and VB Script are simply vehicles that help you reach a solution.
- In recent days, most interviewers are asking questions that either involve writing a script on paper or coding on a QTP installed on the machine. If you can code on a machine or write the code spontaneously, that’s great! If not, I suggest you write the solution to the problem given to you in simple English statements. This will give a chance to showcase your solution forming ability. Explain that to translate this solution into a program is simply a matter of referring to the help files of the programming language to find the equivalent statements.
- In an interview, when you are writing code, please do not forget to include comments. Showcase good programming practices.
- Before attending a QTP interview, be sure to know the version of the QTP, the add-ins that you use, the versions of all the other software you are using, etc.
- If you have not been using QTP recently but have had past experience, it helps to take a couple of hours to re-familiarize with the IDE.
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.
- What are the reasons for choosing to automate your project and why did you choose QTP?
- What is the most challenging testing situation you faced and how did you overcome it?
- Did QTP prove efficient for your project? Yes, or No, explain?
- How did you achieve reusability via QTP?
- Did you find anything in your project that QTP proved inefficient to perform?
- 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,
- How many scripts did you have?
- How often were they executed?
- How many lines of code in each script?
- Did you use function libraries and/or shared ORs?
- How long to develop a script?
- 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 the 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 Testing questions.
Below these questions, we have covered the latest UFT Interview questions and answers as well.
QTP Interview Questions And Answers
Most Asked QuickTest Professional Interview Questions
Q #1) Different types of QTP test assets and their extensions:
Q #2) Technologies supported by QTP:
Answer: 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
Q #3) Does QTP run in any environment?
Answer: No, QTP works only in the Windows environment.
Q #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.
Q #5) What is QTP’s model for test creation?
- Determine Testing needs – Define testing environment, Analyse your application and plan actions
- Set up repositories – Local or Shared OR
- Define function libraries
- Generate test steps – Add steps, Add checkpoints
- Data drive your tests
- Run the tests
Q #6) What are the different kinds of Test steps?
Answer: 5 types of steps:
- Test Object ( Performs actions on a TO)
- Utility (Steps to control run session. For example, Reporter.report)
- Programming logic (Loop, conditions…etc)
Q #7) What are the different ways to invoke an application using QTP?
SystemUtil.Run ( FileName, Parameters, Path, Operation )
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.
Set testshell= CreateObject (“Wscript.shell”)
testshell.run “%windir%\notepad “
Q #8) What are the different Recording modes and how do they work?
Answer: QTP provides 3 modes of Recording:
- Normal Recording mode: The default recording method is always the normal mode. This method uses the model of Test Objects and Runtime objects to learn and act on the AUT.
- Analog recording mode: Records the exact mouse and keystrokes that the user performs in relation to either the screen or the AUT window. The steps that are recorded using this method cannot be edited.
The way this usually gets represented in code is:
One scenario in which this type of recording can be used is when we are trying to capture a signature.
- Low-Level recording mode: This mode records the coordinates in the application where the operation is performed, irrespective of whether QTP recognizes the specific Object or Operation.
Q #9) Which Recording modes need more memory?
Answer: Analog and Low-level Recording modes
Q #10) Is it possible to switch between Recording modes during a Test creation?
Answer: 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
Q #11) Does Low-level Recording capture mouse movements?
Answer: No. Mouse movements are not captured.
Q #12) How does QTP identify an object?
Answer: QTP has a predetermined set of properties that it learns/stores for every class of object it identifies. There are 3 aspects to this:
- Mandatory properties: This is the list of properties for a certain class that QTP always stores. We could say that this is the object description. It also checks this in conjunction with the parent object to see if the description is sufficient to identify the object uniquely.
- Assistive properties: In case the description of mandatory properties is insufficient to identify the Object a set of non-mandatory properties will be added to the description one after the other until there is enough data to identify the object.
- Ordinal Identifier: If the assistive properties also do not result in the unique identification of an object a special ordinal identifier is added by QTP, such as the object's location on the page or in the source code.
Q #13) What is Smart Identification?
Answer: If the recorded description does not enable QTP to identify a specific object then QTP uses the “Smart identification” mechanism. It uses the following additional properties to identify the object:
- Base Filter Properties (primary): The set of properties that cannot be changed without changing the object type
- Optional Filter Properties (secondary): Additional properties that help identify the object uniquely.
Q #14) What is Object Spy?
Answer: 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.
Q #15) What is an Object Repository?
Answer: 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.
Q #16) What are the two types of Repositories available, explain them?
Answer: 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.
Q #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?
Answer: If a local OR and Shared OR have an object with the same name, the action will consider the object in its local OR.
Q #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?
Answer: 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.
Q #19) Can the user toggle between using Local OR and shared OR for the same action?
Answer: 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.
Q #20) Are Shared ORs read-only?
Answer: 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.
Q #21) What are the advantages of Test Automation?
- Time – It produces quick results
- No Manual intervention
- Not prone to human errors
Q #22) If the objects hierarchy is changing from build to build, then how you will handle that condition?
Answer: In this case, the descriptive programming can be used instead of having an OR. Even while descriptive programming tries to use regular expressions to identify the unique property of the objects.
Q #23) 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?”
- Firstly, QuickTest Add-In for Quality Center has to be installed.
- In the QTP Tools > Options >run tab you should have ‘Allow other Mercury products to run tests and components' selected.
- Make sure you are running QTP as an Admin
- All the test resources have to be in the correct path
Q #24) What is the extension of the QTP Local Repository? If it is .mtr then what is .bdb extension stands for?
Answer: .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.
Q #25) What is the virtual object?
Answer: A virtual object is a non-standard object that is instructed by the tester via QTP to behave like a standard one. More details in tutorial #23
Q #26) How do you capture tooltip using QTP?
Answer: Tool Tip capture method varies depending on the type of object this tooltip 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.
Q #27) How can you close the second opened browser?
Answer: 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:
Q #28) How do know the number of browsers opened?
Answer: 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)
Q #29) What is synchronization point in QTP?
Answer: 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. More information in tutorial #24.
Q #30) What is a reusable action?
Answer: An action that can be called multiple times within or outside the same test is called the reusable action. By default all actions are reusable. More information in tutorial #21.
Q #31) Why do we use breakpoints in QTP?
Answer: This is to stop the execution of your test at a certain point while it's 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.)
Q #32) What is throw object?
Answer: 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.
Q #33) How do you know the location Id of an object if you know its index id?
Answer: 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. For Example, if you have 2 links, then index id=0 will be the 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.
Q #34) What test cases can you automate using QTP?
Answer: 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.
Q #35) How to handle Java tree in QTP?
Answer: 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.
Q #36) How to give a call to another action from one action?
Answer: Calling one action from the other can be done by “Inserting a call” to an existing action or by creating a new action. Please refer to tutorial #21 for a detailed explanation.
Q #37) How to find Operating system information using the QTP script?
Answer: You can do that with the help of the environment variable. The exact variable is, OS and OSVersion are for the version information.
Q #38) How can you identify the browser and its information using the QTP script?
Answer: 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.
Q #39) How are actions and functions different in QTP?
Answer: 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 to tutorial #21 for a detailed explanation of these.
Q #40) Explain how to use QTP to check broken links on a page?
Answer: 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 choose the option to check for broken links automatically on every page QTP accesses. More information in tutorial #15.
Q #41) Can we run multiple QTP scripts one after the other without manual intervention? How?
Answer: Yes. To do so, you will have to create a batch file using the batch runner tool and information about the same is available in tutorial #23.
Q #42) Explain the process of smart Identification in QTP
Answer: 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”. For more information please refer to tutorial #23.
Q #43) When to use a shared and local Object Repository?
Answer: The decision is completely up to you. Shared OR will make more sense when you have multiple scripts referring to the same objects.
Q #44) What are the advantages of Object Repository?
Answer: 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.
More information on OR in tutorial #22.
Q #45) In the Hybrid framework, data can access the database, excel file, XML, etc. Is it true?
Answer: Yes. Any of the mentioned data sources are permissible.
Q #46) How to associate function library at a run time?
- You can do so by using the “LoadFunctionLibrary” method. LoadFunctionLibrary “Complete path”
- You can also use the ExecuteFile method. ExecuteFile “Complete path”
Q #47) The hybrid framework can be implemented for any application. Is it true?
Q #48) Hybrid framework supports Descriptive programming. Is it true?
Answer: 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 your test itself.
Q #49) What are the advantages of a Hybrid framework?
Answer: The 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 versatility. It can be tailored to meet any testing project's need.
Q #50) What is Procedure or Subroutine in VB Script?
Answer: 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 ().
Q #51) Is VB Script Case sensitive or Case insensitive?
Answer: It is not case sensitive with respect to command and variable names. Everything else, like strings (text) is.
Q #52) How to record application running on the Virtual machine?
Answer: You can access and record the QTP script as long as the application is available to you via a browser and not by using the remote connecting software.
Q #53) What are the factors on which script execution time is dependent?
- Network and computer speeds. The response time from the app, the database, etc. This is true even if you are manually executing the test.
- It also depends on the wait statements you have included.
- Not loading the add-ins that your test does not use helps too.
- Descriptive programming steps take longer than regular ones to execute
- Capturing screenshots at runtime through QTP also consumes time
- Disabling smart identification also speeds up the QTP script running time
Q #54) What is Test Fusion Report in QTP?
Answer: Test Fusion report as the name indicates is a detailed test result that QTP provides in a tree format. It has all the iteration information, data used for each of them along with the standard information.
Q #55) Both Static and dynamic arrays are handled by VB script. Is it true?
Answer: 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.
Q #56) What is the difference between the Keyword view and the Expert view?
Answer: They are two ways QTP shows your test. Each one has its own features and caters to users of different levels of expertise.
Keyword view: This is a tabular representation of your test that has 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.
Q #57) On the website, the protocol has been changed Http: to https what you will do? Tell me your approach?
Answer: Since the protocol change does not necessarily affect the UI change, except maybe 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.
Q #58) What are the features and benefits of Quick Test Pro(QTP)?
- Keyword-driven testing
- Suitable for both client-server and web-based application
- VB script as the script language
- Better error handling mechanism
- Excellent data-driven testing features
Q #59) How to handle the exceptions using the recovery scenario manager in QTP?
Answer: You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during a test run. The recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps
- Triggered Events
- Recovery steps
- Post-Recovery Test-Run
Q #60) What is the use of Text output value in QTP?
Answer: Output values enable to view the values that the application talks during runtime. When parameterized, the values change for each iteration. Thus by creating output values, we can capture the values that the application takes for each run and output them to the data table.
Q #61) How to use the Object Spy in QTP 8.0 version?
Answer: There are two ways to Spy the objects in QTP
- Thru file toolbar: In the File ToolBar click on the last toolbar button (an icon showing a person with hat).
- Thru ObjectRepository Dialog: In Object Repository dialog click on the button “object spy…” In the Object, spy Dialog click on the button showing hand symbol. The pointer now changes in to a hand symbol and we have to point out the object to spy the state of the object. If at all the object is not visible or window is minimized then hold the Ctrl button and activate the required window to and release the Ctrl button.
Q #62) What is the file extension of the code file and object repository file in QTP?
Answer: File extension of
- Per test object rep: filename.mtr
- Shared Object rep: filename.tsr
- Code file extension id: script.mts
Q #63) Explain the concept of object repository and how QTP recognizes objects?
Answer: Object Repository: displays a tree of all objects in the current component or in the current action or entire test( depending on the object repository mode you selected). We can view or modify the test object description of any test object in the repository or add new objects to the repository.
QuickTest learns the default property values and determines in which test object class it fits. If it is not enough it adds assistive properties, one by one to the description until it has compiled the unique description. If no assistive properties are available, then it adds a special Ordinal identifier such as objects location on the page or in the source code.
Q #64) What are the properties you would use for identifying a browser and page when using descriptive programming?
Answer: “name” would be another property apart from the “title” that we can use. OR We can also use the property “micClass”.
For Example, Browser(“micClass:=browser”).page(“micClass:=page”)
Q #65) What are the different scripting languages you could use when working with QTP?
Answer: You can write scripts using the following languages:
Q #66) Tell some commonly used Excel VBA functions.
Answer: Common functions are:
Coloring the cell, Autofit cell, setting navigation from the link in one cell to other saving
Q #67) Explain the keyword createobject with an example.
Answer: Creates and returns a reference to an Automation object
syntax: CreateObject(servername.typename [, location])
server-name: Required. The name of the application providing the object.
type name: Required. The type or class of the object to create.
location: Optional. The name of the network server where the object is to be created.
Q #68) Explain in brief about the QTP Automation Object Model.
Answer: Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties.
Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods.
You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program.
Q #69) How to handle dynamic objects in QTP?
Answer: QTP has a unique feature called Smart Object Identification/recognition. QTP generally identifies an object by matching its test object and run-time object properties.
QTP may fail to recognize the dynamic objects whose properties change during run time. Hence it has an option of enabling Smart Identification, wherein it can identify the objects even if their properties change during run time.
Check out this:
If QuickTest is unable to find any object that matches the recorded object description, or if it finds more than one object that fits the description, then QuickTest ignores the recorded description and uses the Smart Identification mechanism to try to identify the object.
While the Smart Identification mechanism is more complex, it is more flexible, and thus, if configured logically, a Smart Identification definition can probably help QuickTest identify an object, if it is present, even when the recorded description fails.
The Smart Identification mechanism uses two types of properties:
- Base filter properties: The most fundamental properties of a particular test object class; those whose values cannot be changed without changing the essence of the original object. For Example, if a Web link's tag was changed from to any other value, you could no longer call it the same object.
- Optional filter properties: Other properties that can help identify objects of a particular class as they are unlikely to change on a regular basis, but which can be ignored if they are no longer applicable.
Q #70) What is a Run-Time Data Table? Where can I find and view this table?
Answer: In QTP, there is a data table used, which is used at runtime.
- In QTP, select the option View->Data table.
- This is basically an excel file, which is stored in the folder of the test created, its name is Default.xls by default.
Q #71) How do Parameterization and Data-Driving relate to each other in QTP?
Answer: To data-driven, we have to parameterize. i.e. we have to make the constant value as a parameter so that in each interaction(cycle) it takes a value that is supplied in a run-time data table.
Through parameterization only we can drive a transaction (action) with different sets of data. You know running the script with the same set of data several times is not suggested, and it's also of no use.
Q #72) What is the difference between Call to Action and Copy Action?
Answer: Call to Action: The changes made in Call to Action will be reflected in the original action (from where the script is called). But whereas in Copy Action, the changes made in the script, will not affect the original script(Action)
Q #73) Explain the concept of how QTP identifies the object.
Answer: During recording, QTP looks at the object and stores it as a test object. For each test object, QT learns a set of default properties called mandatory properties, and look at the rest of the objects to check whether these properties are enough to uniquely identify the object. During the test run, QTP searches for the runtime objects that match with the test object it learned while recording.
Q #74) Differentiate the two Object Repository Types of QTP.
Answer: Object Repository is used to store all the objects in the application being tested.
Types of object repository: Per action and Shared repository.
In the Shared Repository only one centralized repository for all the tests, whereas in Per action for each test a separate per action repository is created.
Q #75) What the differences are and best practical application of Object Repository?
Per Action: For Each Action, one Object Repository is created.
Shared: One Object Repository is used by the entire application
Q #76) Explain what the difference between Shared Repository and Per Action Repository
Shared Repository: Entire application uses one Object Repository, that similar to Global GUI Map file in WinRunner
Per Action: For each Action, one Object Repository is created, like GUI map file per test in WinRunner
Q #77) Have you ever written a compiled module? If yes tell me about some of the functions that you wrote.
Answer: Sample answer (You can tell about modules you worked on. If your answer is Yes then You should expect more questions and should be able to explain those modules in later questions): I Used the functions for Capturing the dynamic data during runtime. The function used for Capturing Desktop, browser and pages.
Q #78) Can you do more than just capture and playback?
Answer: Sample answer (Say Yes only if you worked on): I have done Dynamically capturing the objects during runtime in which no recording, no playback and no use of the repository is done AT ALL.
-It was done by the windows scripting using the DOM(Document Object Model) of the windows.
Q #79) How to do the scripting. Are there any inbuilt functions in QTP? What is the difference between them? How to handle script issues?
Answer: Yes, there's an inbuilt functionality called “Step Generator” in Insert->Step->Step Generator -F7, which will generate the scripts as you enter the appropriate steps.
Q #80) What is the difference between checkpoint and output value?
Answer: An output value is a value captured during the test run and entered in the run-time but to a specified location.
For Example, Location in Data Table[Global sheet / local sheet]
Q #81) How many types of Actions are there in QTP?
Answer: There are three kinds of actions:
- Non-reusable action: An action that can be called only in the test with which it is stored, and can be called only once.
- Reusable action: An action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests.
- External action: A reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.
Q #82) I want to open a Notepad window without recording a test and I do not want to use System utility Run command as well. How do I do this?
Answer: You can still make the notepad open without using the record or System utility script, just by mentioning the path of the notepad “( i.e. where the notepad.exe is stored in the system) in the “Windows Applications Tab” of the “Record and Run Settings window.
Most Popular UFT Interview Questions And Answers
HP UFT (Hewlett Packard – Unified Functional Testing) earlier was called as HP QTP (Hewlett Packard – Quick Test Professional). This tool is used for Automation Testing of applications or websites.
With the help of this tool, we perform various types of testing like functional testing, regression testing, etc. HP UFT can also be used at an enterprise level for testing purposes. VB (Visual Basic) scripting language is used in UFT, which is a bit easy and a simple language when compared to the other OOP (Object Oriented Programming) languages.
Using HP UFT, a tester can test both the front-end and back-end of the software applications. Front end testing part is called GUI testing and the back-end testing part is called API (Application Programming Interface).
With this tool, we can test the entire application or a specified part/logic/object of the application.
Note: Using the UFT tool one can run and test the software web application on remote MAC machines with the help of the Safari browser.
Here we go with the most common interview questions and answers on HP UFT:
Q #1) Which features or drawbacks of QTP lead to the upgrade for a newer version?
Answer: They include:
- The main feature of QTP i.e., “testing only GUI” lead to the upgrade for a newer version of the software.
- QTP contains very big tests, which lead to the consumption of more memory. Due to this, the CPU gets utilized for a longer time and this affects the system’s speed.
- The results of scripts executed in QTP are saved as HTML files instead of text (.txt) files. With this, the size of the result files or group of files will occupy more system space.
Q #2) How is UFT 11.5 version different from UFT 12.0?
Answer: UFT 11.5 version is a combination of GUI and API, whereas UFT 12.0 is a combination of GUI, API and BPT (Business Process Testing).
Q #3) Define Error Pane of UFT.
Answer: While working on scripts like executing, saving, opening the scripts etc, we may face few errors. Such errors are listed and displayed in an area known as ‘Error Pane’.
The types of errors listed in Error Pane include:
- Code syntax errors
- Missing resources
- Missing references and property values
Note: Earlier in QTP, Information Pane is used in capturing code syntax errors.
Q #4) Can UFT be connected to Quality Center? If ‘Yes’ brief the process or steps.
Answer: Yes, UFT can be connected to QC.
This can be done from the front end or GUI as shown below:
Go to the menu File -> Select ‘Quality Center’, and then you will be prompted to enter the URL of the Quality Center.
After entering the URL it also asks for the login credentials like user id, password, project, etc. Enter the required details and then you will be able to execute the scripts from QC.
Q #5) Is it possible to use two instances of UFT on the same machine? If not why?
Answer: No, we cannot use two instances of UFT on the same machine. However, UFT handles multiple instances of the application that is going to be tested.
We can even work on two different applications on the same machine without stopping the recording of UFT. For this, you need to modify a few configuration settings of the UFT.
You need to select the option “Record and Run on any opened application” from Automation -> Record and Run settings -> select.
For Example, UFT can work on multiple windows of IE browser.
Q #6) What is meant by Output Value in UFT?
Answer: An Output Value step is used to capture the value from any field or value of any object property when the script execution is going on. And such values are stored in the desired location in the data table and can be used as input for the other fields or objects at another point in the test script.
There are four types of output values, which include:
- Standard Output value
- Text or Text Area Output Value
- Database output value and
- XML output value
Q #7) Define Environment Variable in UFT and its uses.
Answer: In UFT we use a few global variables to store the global data like User Id, Password. Such global variables are termed as Environment variables.
There are three types of environment variables in UFT, which include:
- Built-in (Read-Only)
- User-defined – Internal (Read-Only)
- User-defined – External (Read / Write)
Uses of Environment Variables include:
- With the help of these environment variables, the parameters are defined in the test scripts.
- These environment variables are used in various tests or actions.
- We can store the links to websites (URLs), testing environment details, etc., in these environment variables.
Q #8) Brief the process of testing with UFT.
Answer: There are seven phases of the testing process using UFT:
#1) Preparing the Plan for Testing: In this phase, you will decide and select the environment, system configuration, etc., used for testing. Even you will prioritize the steps that are involved in testing and identify the test data too.
It also will predict the expected output of the scripts.
#2) Capturing the actions performed on the Application: In this phase, you will perform the testing steps or actions on the website/application that is to be tested. Simultaneously, UFT will automatically record and capture the testing activities that are executed in the application.
#3) Boosting the Test Script: This phase will make the test script more attractive by adding extra effects like inserting the checkpoints, parameterization, declaring the output values etc.
#4) Executing the Test Script again: At this stage, the test script is executed once again in order to check whether the script runs smoothly with the extra additions made in the previous step.
If any bugs are detected then they are debugged and fixed.
#5) Actual execution of the test script in the application: Now run the test script to perform the actual execution in this phase.
#6) Examining the test results: After the test execution, the results are analyzed from the test report generated.
#7) Analyzing the defects: If we find any bugs during the execution that leads to the failure of the test script then the same should be reported in the Defects Report.
Q #9) Suggest and Define a solution for an application whose objects are not recognized by UFT.
Answer: When an object is not recognized by UFT then we need to follow a few basic points like verifying whether all the required Add-ins are loaded or not, search for any UFT patches, etc.
There are 3 stages of solutions to sort out this issue.
- Tool Level Solution – At this level, we try to use low-level recording mode, the configuration of virtual objects, etc.
- Organization Level Solution – Try to gather appropriate properties or information of objects that are not recognized by UFT. Generally, development teams will be aware of all the properties of the objects.
- Vendor Level Solution – Consult the respective vendors regarding this issue and raise a ticket/token for the same.
Q #10) What is the use of running the scripts in Hidden-mode in UFT?
Answer: A user can actually run the test scripts of UFT in Hidden-mode. Running the test scripts in this mode will improve the execution and its speed. As User intervention is not required during the execution of scripts this hidden mode can be used easily.
The test results can be viewed by the user after the script execution gets completed. To enable this hidden mode, go to “Remote Agent Setting” and select the option “Run UFT in hidden mode”.
Q #11) What is Cross browser testing? Does UFT support it?
Answer: Yes, UFT supports testing across various browsers like Chrome, Safari, IE, Firefox, etc.
With this feature, we can record the script on one browser and run the same on another browser without any configuration changes.
Q #12) What is Distributed testing? How does UFT support it?
Answer: Distributed Testing means testing the application on multiple machines, clients, servers, mobiles, etc. UFT supports this distributed testing with a new feature called “Run-time engine”.
Q #13) Describe the differences between functions and actions in UFT.
Answer: Below points explain how functions are different from actions.
- Functions are not associated with Object Repository and Data Table whereas Actions maintain their own Object Repository and Data Table.
- Functions are elements of VB scripting that are not only restricted to UFT whereas Actions are elements of UFT.
- With the help of functions, the code gets re-used and with actions, the test gets re-used.
- The common feature between functions and actions is that both are associated with input parameters, output parameters and return values.
- A Script can be divided into multiple Actions like Sign In, Sign Out, etc., whereas Function is created in a script.
Action Example: Entering any value or data in any field or clicking on any button of an application is termed as an Action. (Entering 20 against the age field is termed as action or Clicking on the Submit button is also an action).
Function Example: Any calculation part or formulae behind clicking on any button is termed as a Function. (After clicking on the ADD button, the addition performed at the back-end is done by a function).
Q #14) What are the various types of Actions in UFT?
Answer: “Action” means a step or a group of steps used in testing an application. Each script has only one action.
Generally, there are 3 types of actions.
- Non- Reusable Action: This action can be called only once by the test in which it is written or saved.
- Reusable Action: Can call this as many times as required by the test. It is also saved in the test itself.
- External Action: The name itself, explains that this action is saved in another (external) test. This works in the same way as the reusable action, just with a difference in its location. And this external action can be edited as well.
Q #15) What is meant by a Check Point in UFT? Also, explain the applicable Check Points.
Answer: Check Point represents the point where a particular condition or value of an object is verified against some other fixed or recent value. Checkpoints can be inserted at any point in the test script.
UFT supports various types of checkpoints.
- Standard Checkpoint – This checkpoint is used to verify the object properties of buttons, lists etc.
- Image Checkpoint – It checks the properties of images.
- Bitmap Checkpoint – It checks the particular zooming property of the images.
- Table Checkpoint – It verifies the details of tables like row height, width etc.
- Text Checkpoint – It checks the position of the text at a particular place.
- Text Area Checkpoint – It checks whether the text is displayed in the specified area or not.
- Accessibility Checkpoint – It checks the standardization of the websites.
- Page Checkpoint – It checks the properties of a web page like the number of hyperlinks and images in a webpage, the time is taken for loading the page, etc.
- Database Checkpoint – It is used to check the database values.
- XML Checkpoint – It is used to verify the information and data related to XML.
Q #16) How is the Bitmap checkpoint different from Image checkpoint?
Answer: Using “bitmap checkpoint” we can compare the point to point positions of the expected and actual output images. This checkpoint works using the pixels of the image area or webpage area.
Whereas Image checkpoint checks only the properties related to the images like its source file, values etc.
For bitmap checkpoint we do not need a particular image, it checks the screen area whereas image checkpoint compulsorily needs an image. Using the bitmap checkpoint we can even test a part of an image.
Q #17) Differentiate the type of test cases that can be automated and which cannot be automated.
Answer: Given below are few:
- We cannot automate the Test Cases which need human interference.
- The newly designed Test Cases are not automated. At least once they should be executed manually.
- Tests that need to be executed repeatedly should be automated.
- Tests that need to be tested with multiple sets of data are automated.
- Test cases based on the requirements that change repeatedly cannot be automated.
Q #18) How many types of Automation frameworks are there in UFT? Describe them.
Answer: Automation Framework – A group of Instructions followed during the scripting or coding is termed as a Framework. These instructions include the format of a datasheet, standards used for coding, etc.
Various Automation frameworks are as follows:
- Linear Scripting
- Data-Driven Testing
- Keyword Driven
- Hybrid Framework
- Test Library Architecture
Q #19) Explain how Selenium is different from UFT.
Below are few differences between Selenium and HP UFT
- Selenium is an open-source tool whereas UFT is not. Selenium does not require any license to use it however UFT does need it.
- UFT supports only VB Scripting whereas Selenium scripting can be done using JAVA, Perl, .net, PHP, etc.
- Using UFT we can test web-based, windows based, and mainframe applications. But Selenium is used to test only web applications.
- Testing through UFT is very expensive than testing with Selenium.
- UFT scripts are more user-friendly than Selenium Scripts.
Q #20) How is a Step generator used in UFT?
Answer: Step Generator is the most useful and important built-in feature of UFT. It is used to add or create the steps in test scripts without recording. We can even record the disabled objects through the step generator.
If we miss any step during recording, then we can add the same with the help of Step Generator.
Q #21) Explain the new feature of UFT regarding the export of test results.
Answer: In the earlier versions of QTP, the user manually exported the test results to PDF or HTML formats.
However, this feature has been automated now in UFT, such that the test results are automatically exported to HTML or PDF files when small changes are made to the settings.
Go to the menu Tools -> Options -> General tab and select ‘Run sessions’.
Q #22) What are the methods used in UFT to handle exceptions or run-time errors?
Answer: In UFT, we have two methods to handle run-time errors or exceptions.
- Creating a recovery scenario and including (linking) the same in each test script.
- By using ‘On Error Resume next’ statement, execution of the script jumps to the next immediate statement in spite of the exception statement.
Q #23) Can you brief the hurdles you faced during Automation testing?
Answer: General hurdles that every automation tester will face during testing are:
- A few times the application under test (AUT) will not be available for testing due to some issues.
- Sometimes the features of the application get changed or modified. This leads to some maintenance issues and causes the testing to be stopped for some duration.
- The automation test environment of the application may not be available.
Q #24) What are the features supported by UFT?
Answer: Generally UFT supports three kinds of features.
- Direct Features – Features that are built-in with a UFT tool window like Data Table, Object Spy, Step generator etc.
- HP Integrated Tools – These tools can be automatically installed if the UFT is installed. Example: Test Batch Runner, Password Encoder, etc.
- Other Integrated Tools – If we want to use these tools, then a user needs to install them. Example: VB Script, SQL etc.
Q #25) Define the Canvas view of UFT.
Answer: Canvas is a display panel, which displays the graphical form of actions of the test flow that happens during the testing process. As per our needs, we can change the actions from the top to bottom.
I hope, this article will be a very useful one for those who are preparing to attend the interview on Automation Testing of UFT/QTP.
It is advisable to go through the tool once and experience its look and feel before facing the interviewer. Go through the previous and the latest versions of QTP/UFT, so that you can get a few more ideas on the differences between various versions.
I hope these questions are useful to prepare for QTP/UFT interview. If you come across any new question please feel free to post comments below. We will try to answer it.
We wish you all success in your Interview!!!