Are you preparing for an upcoming QTP/UFT (Unified Functional Testing) interview? Look no further! We’ve compiled a comprehensive list of the top 100 interview questions and answers to help you ace your interview and secure your dream job as a QTP/UFT professional.
In the ever-evolving world of software testing, QTP/UFT has become an indispensable tool for automating functional testing across various applications and platforms. As a QTP/UFT expert, you’ll be responsible for designing, developing, and executing automated test scripts, ensuring the quality and reliability of software applications.
This guide covers a wide range of topics, from beginner-level QTP/UFT concepts to advanced scenarios and real-world challenges. Whether you’re a fresher seeking your first QTP/UFT role or an experienced professional aiming to showcase your expertise, these questions and answers will provide you with the necessary knowledge and confidence to excel in your interview.
QTP/UFT Interview Questions and Answers for Freshers
-
What are the types of Object Repositories in Micro Focus UFT?
QTP/UFT supports two types of Object Repositories:- Shared Object Repository (also called Global)
- Per-Action Object Repository (also called Local)
-
Which environments are supported by QTP/UFT?
QTP/UFT supports a wide range of environments, including:- Active X
- Delphi
- Java
- .Net
- Oracle
- PeopleSoft
- PowerBuilder
- SAP
- Siebel
- Stingray
- Terminal Emulator
- Visual Basic
- Visual Age
- Web
- Web Services
-
Can we call QTP tests from another test using scripting? If so, how?
Yes, you can call multiple QTP/UFT tests from a main script. To do this, you need to make the Actions in the corresponding scripts reusable. Then, from the destination script, you can make calls to these reusable Actions. -
What is Action Split, and what is its purpose in QTP/UFT?
Action Split is a feature that allows you to divide an existing Action into two parts. The purpose of Action Split is to divide Actions based on their functionality, improving code reuse and maintainability. -
How can you handle Java trees in QTP/UFT?
To handle Java trees in QTP/UFT, you need to select the Java Add-In and launch QTP/UFT. Next, record operations on the Java tree. If you face issues during recording, you can select Tools > Object Identification > Java, tree object, and make changes to the mandatory and assistive properties to enable identification. -
Explain how QTP/UFT identifies objects.
QTP/UFT identifies GUI objects based on their corresponding properties. During recording, QTP/UFT identifies and stores peculiar properties (as defined in the Object Identification settings) in the Object Repository. At runtime, QTP/UFT compares the stored property values with the on-screen properties to uniquely identify the GUI object. -
How many recording modes are available in QTP/UFT, and when would you use each mode?
QTP/UFT supports three recording modes:- Normal mode (also called Contextual mode): This is the default recording mode and is used for most automation activities. It recognizes objects regardless of their position on the screen.
- Low-level recording mode: This mode records the exact x,y coordinates of your mouse operations. It is helpful for testing hashmaps and recording objects not identified by the normal mode.
- Analog mode: This mode records exact mouse and keyboard movements concerning the screen/application window. It is useful for operations such as drawing, recording signatures, and drag-and-drop operations.
-
How can you call one Action from another Action in QTP/UFT?
You can call one Action from another Action in QTP/UFT in two ways:- Call to a copy of Action: In this method, the Action Object Repository, script, and data table are copied to the destination Test Script.
- Call to an existing Action: In this method, the Object Repository, script, and data table are not copied. Instead, a reference is made to the Action in the source script.
-
What are Virtual Objects in QTP/UFT, and why are they used?
Virtual Objects in QTP/UFT are used to define objects that behave like standard objects but are not recognized by the tool. You can map these Virtual Objects to standard classes, such as buttons or checkboxes. QTP/UFT then emulates the user’s actions on the Virtual Object during the run session. -
How can you perform cross-platform testing and cross-browser testing using QTP/UFT?
To perform cross-platform testing and cross-browser testing using QTP/UFT, you need to create separate Actions that cater to different operating systems and browsers. For cross-platform testing, you can use built-in environment variables to determine the OS and call the appropriate Actions. For cross-browser testing, you can extract the browser and version information and call the relevant Actions based on that. -
What is the logical name of an object in QTP/UFT, and what is its purpose?
The logical name is a unique name given by QTP/UFT when creating an object in the repository. This name is used by QTP/UFT to map the object name in the script with its corresponding description in the Object Repository. For example,Browser("Browser").Page("Guru99")
, where “Guru99” is the logical name of the object. -
What is Descriptive Programming in QTP/UFT, and when is it used?
Descriptive Programming in QTP/UFT involves using property names and values directly in the script, instead of storing the object and its property values in the Object Repository. It is useful when QTP/UFT has difficulty identifying objects from the Object Repository, or when storing certain objects in the repository is not appropriate. -
What properties would you use for identifying a browser and page when using Descriptive Programming in QTP/UFT?
When using Descriptive Programming in QTP/UFT to identify a browser and page, you can use thename
property or themicClass
property. For example:Browser("name:=xxx").Page("name:=xxxx")
Browser("micClass:=browser").Page("micClass:=page")
-
Can you record an application running on a remote machine using QTP/UFT?
Yes, you can record an application running on a remote machine using QTP/UFT, provided you are accessing the application through the local browser and not through a remote desktop solution like Citrix. If you are still unable to record, it is advisable to install QTP/UFT and the application on the same machine. -
Explain the
CreateObject
keyword in QTP/UFT with an example.
TheCreateObject
keyword in QTP/UFT creates and returns a reference to an Automation object. Its syntax is:CreateObject(servername.typename [, location])
Example:Set IE = CreateObject("InternetExplorer.Application")
-
Can you switch between Per-Action and Shared Object Repositories in QTP/UFT? If yes, how?
Yes, you can switch between Per-Action and Shared Object Repositories in QTP/UFT. To do this, go to Test > Settings > Resources, where you will have the option to choose the desired repository type. -
What is Object Spy in QTP/UFT, and how do you use it?
Object Spy in QTP/UFT helps determine the run-time and test-time object properties and methods of the application under test. You can access Object Spy directly from the toolbar or through the Object Repository dialog box. It is very useful when implementing Descriptive Programming. -
Why are ordinal identifiers not given top priority in Object Identification, even when they can make an object unique?
While ordinal identifiers (such as indexes) can make an object unique, they are not given top priority because:
a) If two objects are overlapped, location-based object recognition may fail.
b) If only index-based recognition is used, script execution time may increase.
Therefore, mandatory and assistive properties are used for more reliable object identification. -
What is the file extension of the code file in QTP/UFT?
The file extension for code files in QTP/UFT is.mts
(Micro Focus Test Script). -
Briefly explain the QTP/UFT Automation Object Model.
The QTP/UFT Automation Object Model deals with the automation of QTP/UFT itself. Almost all configurations and functionality provided by QTP/UFT are represented by its Automation Object Model. Nearly all dialog boxes in QTP/UFT have a corresponding Automation Object, which can be set or retrieved using the corresponding properties or methods. QTP/UFT Automation Objects can be used along with standard VBScript programming elements like iterative loops or conditional statements to design custom scripts. -
What is the purpose of Text Output values in QTP/UFT?
Text Output values in QTP/UFT enable you to capture text appearing on the application under test during runtime. If parameterized, Text Output values will capture values appearing in each iteration, which will be stored in the run-time data table for further analysis. -
What is the Step Generator in QTP/UFT, and how is it used?
The Step Generator in QTP/UFT allows you to add Test Steps to your script without actually recording them. It enables you to create and insert Test Steps programmatically, providing more flexibility and control over your test scripts. -
How can you make QTP/UFT understand the difference between the same types of objects, such as multiple checkboxes on a page?
To make QTP/UFT distinguish between the same types of objects, you can use ordinal identifiers (like indices) along with a bit of Descriptive Programming for object recognition. For example, if there are five checkboxes on a page and you need to select the second one, you can use the index along with other identifying properties in your script. -
What is the Test Fusion Report in QTP/UFT, and what does it contain?
The Test Fusion Report in QTP/UFT displays all aspects of a test run and is organized in a tree format. It provides details of each step executed for all iterations, including the run-time data table, screenshots, and a movie of the test run (if opted for). -
How can you handle exceptions in QTP/UFT?
In QTP/UFT, exceptional handling can be done in two ways:
a) Using Recovery Scenarios: You define Triggered Events, Recovery Steps, and Post-Recovery Test-Run actions.
b) Using theOn Error
statement: You can useOn Error Resume Next
andOn Error Go to 0
statements to handle exceptions at the script level. -
What are the types of Environment Variables in QTP/UFT?
QTP/UFT supports three types of Environment Variables:- Built-in (Read-only)
- User-defined Internal (Read-only)
- User-defined External (Read/Write)
-
What is the difference between a Bitmap Checkpoint and an Image Checkpoint in QTP/UFT?
A Bitmap Checkpoint in QTP/UFT performs a pixel-to-pixel comparison of an image or part of an image. On the other hand, an Image Checkpoint does not perform a pixel-to-pixel comparison but instead compares image properties like alt text and destination URLs. -
What is the difference between Functions and Actions in QTP/UFT?
Actions in QTP/UFT have their own Object Repository and Data Table. Actions help make your tests modular and increase code reuse. For example, you can divide your script into Actions based on functionality like Login, Logout, etc.
Functions, on the other hand, are VBScript programming concepts and do not have their own Object Repository or Data Table. Functions help in code reuse, such as creating a function to concatenate two strings. -
What is the Keyword View and Expert View in QTP/UFT?
The Keyword View in QTP/UFT is an icon-based view that shows test steps in a tabular format. It automatically generates documentation for the test steps.
The Expert View in QTP/UFT displays the corresponding VBScript statement for every test step in the Keyword View. -
Briefly explain the QTP/UFT testing process.
The QTP/UFT testing process consists of six main phases:- Create your test plan: Identify test steps, test data, expected results, and system configurations.
- Record a session on your application: Execute test steps, and QTP/UFT will automatically record corresponding VBScript statements.
- Enhance your test: Insert checkpoints, output values, parameterization, and programming logic.
- Replay and debug: Replay the script to check if it’s working correctly and debug if necessary.
- Run your tests: Perform the actual execution of your Test Script.
- Analyze the test results: Analyze the results in the generated Test Fusion report.
- Report defects: Report any identified incidents, potentially using Quality Center for failed tests.
UFT/QTP Interview Questions and Answers for Experienced Candidates
-
What are the different types of Test Automation Frameworks available in QTP/UFT?
The different types of Test Automation Frameworks in QTP/UFT are:- Linear Scripting (Record & Playback)
- Test Library Architecture Framework
- Data-Driven Testing Framework
- Keyword-Driven or Table-Driven Testing Framework
- Hybrid Test Automation Framework
-
How can you check a web application for broken links using QTP/UFT?
You can use the Page Checkpoint in QTP/UFT, which provides a count of valid and invalid links on a page. -
What is a Run-Time Data Table in QTP/UFT, and where can you find and view it?
The Run-Time Data Table in QTP/UFT stores data like parameterized output, checkpoint values, and output values. It is an Excel file stored in the Test Results Folder and can also be accessed in the Test Fusion Report. -
What is the difference between a Checkpoint and an Output Value in QTP/UFT?
A Checkpoint in QTP/UFT is a verification point that compares the current value of a specified property with the expected value. Based on this comparison, it generates a PASS or FAIL status.
An Output Value in QTP/UFT is a value captured during the test run and can be stored in a specified location like the Data Table or a variable. Unlike Checkpoints, Output Values do not generate a PASS/FAIL status. -
How can you connect to a database using VBScript in QTP/UFT?
To connect to a database using VBScript in QTP/UFT, you need to know the following:
a) Connection string of your server
b) Username
c) Password
d) DNS name
You can code the database connectivity command directly or use the SQL Query tool provided by QTP/UFT. -
What is the QTP/UFT Batch Testing Tool, and how is it used?
The QTP/UFT Batch Testing Tool allows you to run multiple scripts simultaneously. Once the scripts are added to the tool, it will automatically open and start executing them one after the other. -
What are some drawbacks of QTP/UFT (as of version 10)?
Some drawbacks of QTP/UFT (as of version 10) include:- Huge tests in QTP/UFT consume a lot of memory and increase CPU utilization.
- Since QTP/UFT stores results in HTML files (instead of text files), the result folder can become quite large.
-
What is an Optional Step in QTP/UFT, and how do you add one?
An Optional Step in QTP/UFT is a step that is not mandatory to be executed. If the corresponding GUI object is present, QTP/UFT performs the operation on it. If the GUI object is not present, QTP/UFT bypasses the Optional Step and proceeds to the next step.
To add an Optional Step in the Keyword View, right-click and select “Optional Step.” In the Expert View, add theoptional
keyword to the beginning of the VBScript statement. -
What is
Reporter.ReportEvent
in QTP/UFT, and how is it used?Reporter.ReportEvent
is a standard method provided by QTP/UFT to send custom messages to the test results window. Its syntax is:Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath]
whereEventStatus
can be:- 0 or
micPass
- 1 or
micFail
- 2 or
micDone
- 3 or
micWarning
You can also send screenshots to the test results window using this method.
- 0 or
-
How do you declare a variable in QTP/UFT?
In QTP/UFT, you declare a variable using theDim
keyword
QTP Interview Questions and Answers
FAQ
Is UFT still in demand?
What is the difference between UFT and QTP?
Which of the following is used to handle unexpected conditions and situations in QTP?
Which tool is best UFT or selenium?