UFT Interview Questions

UFT Interview Questions and Answers

1) What is UFT?

HP Unified Functional Testing (UFT) software, formerly known as HP Quick Test 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.

2) What is the latest version of UFT available in the market?

Unified Functional Testing 12.02

3) What is Environment Variable in UFT and why to use it?
Environment variables are global variables in UFT and they are used to store the global values like User Id, password of the Application.

4) How many types of Test Recording modes in the UFT?
The UFT enable us with Four type of recording modes:

Normal (Default recording mode) 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.

Insight Recording:

5) What types of License is available for UFT?
•    Seat License: It is a machine locked license. This license can be used only for a machine it was generated.
•    Floating License: It can be used on any machine which has network access to the floating license server. At any point in time the machines using the QTP license cannot exceed maximum license count on the server.

6) What is the use of object spy tool in UFT?
UFT provides one tool called object spy that can be used to find out the properties and the values of the object in UFT.

7) What are the types of error need to be handle in UFT?
There are three types of error that one will face in UFT
•    Syntax Errors
•    Logical Errors
•    Runtime Errors

8) what are the ways you can handle run time errors?
There are various ways to handle run time errors, they are:

•    Using test settings
•    Using on error statement
•    Using err Object
•    Using Exit Statement
•    Recovery Scenarios
•    Report Object

9) What is the difference between exit action and exit iteration?
Exit action is used when we want to exit from a particular action, while exit iteration is used to exit from a particular action iteration of an action.

10) What are the loops available in UFT and what they do?
There are 4 loops available in VBScript for UFT?

•    For...Next: For Next Loop will execute a series of statements until a specific counter value
•    While...Wend Loop: While Wend Loop is used to execute a series of statements as long as given condition is true.
•    Do...Loop: Do Loop will run a block of statements repeatedly
•    For Each...Next: In order to execute a series of statements for each statements for each object in collection “For Each Loop” is used

11) How will you call from one action to another action?
We can call an action in 2 ways,
•    Call to copy of Action. - In this, the Action Object Repository, Script and Datable will be copied to the destination Test Script.
•    Call to Existing Action. - In this, ObjectRepository, Script and Data table will NOT be copied but a call (reference) would be made to the Action in the source script.

12) What are Virtual Objects?
Your application may contain objects that behave like standard objects but are not recognized by QTP. You can define these objects as virtual objects and map them to standard classes, such as a button or a check box. QTP emulates the user's action on the virtual object during the run session. In the test results, the virtual object is displayed as though it is a standard class object.

13) How to perform Cross platform testing and Cross browser testing using UFT? Can u explain giving some example?
You will need to create separate Actions which take care of different OS and Browsers
•    Cross Platform Testing: Using the Built in Environment Variable you can dig up the OS information.E.g. Platform = Environment ("OS"). Then based on the Platform you need to call the actions which you recorded on that particular platform.
•    Cross Browser Testing: Using this code e.g.Browser ("Core Values").GetROProperty("version") you can extract the Browser and its corresponding version. Ex: Internet Explorer 6 or Netscape 5. Based on this value you call the actions which are relevant to that browser.

14) What is descriptive programming?
•    Typically, an object and its properties must be recorded in the Object Repository to enable QTP to perform action s on it.
•    Using descriptive programming, you do not store the object and its property values in the Object repository but mention the property value pair directly in the script.
•    The idea behind descriptive programming is not bypass the object repository but help recognize dynamic objects.

15) What are the properties you would use for identifying a browser & page when using descriptive programming?
You can use the name property
Ex: Browser ("name: ="xxx"").page ("name: ="xxxx"").....
We can also use the property "micClass".
Ex: Browser ("micClass: =browser").page ("micClass: =page")....

16) Explain the keyword CreateObject with an example?
Creates and returns a reference to an Automation object
SYNTAX: CreateObject (servername.typename [, location])
Servername: Required. The name of the application providing the object.
Typename:  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.
Example: Set IE = CreateObject ("InternetExplorer.Application")

17) Can you switch between Per-Action and Shared Object Repository? If yes how?
Yes .We can switch. Go to Test--->Settings--->Resources. Here you have an option to choose repositories.

18) What is Object Spy? How to Use it?
•    Object Spy helps in determining the run & test time object properties & methods of the application under test.
•    You can access object spy directly from the toolbar or from the Object Repository Dialog Box.
•    It is very useful during Descriptive Programming

19) What is the use of Text output value in QTP?
Text Output values enable you to capture text appearing on the application under test during run-time.
If parameterized, text output values will capture values appearing in each iteration which would be stored in the run-time data table for further analysis.

20) What is Step Generator?
Step Generator enables us to Add Test Steps in your script. Using step generator you can add steps to your script without actually recording it.

21) What is Test Fusion Report?
•    Test Fusion Report, displays all aspects of a test run and is organized in a Tree format.
•    It gives details of each step executed for all iterations.
•    It also gives Run-time data table, Screen shots and movie of the test run if opted.

22) Explain the Checkpoints in UFT?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.
UFT supports 12 types of checkpoints:

•    Standard Checkpoint
•    Text Checkpoint
•    Text Area Checkpoint
•    Bit Map Checkpoint
•    Accessibility Checkpoint
•    Database Checkpoint
•    XML Checkpoint (From Resource)
•    XML Checkpoint (From Application)
•    File Content Checkpoint
•    Page Checkpoint
•    Image Checkpoint
•    Table Checkpoint

23) What is the Difference between Bitmap Check point & Image Check point?
Bitmap checkpoint does a pixel to pixel comparison of an image or part of an image.
Image checkpoint does do a pixel to pixel comparison but instead COMPARE image properties like alt text, destination URL etc.

24) What factors affect bitmap checkpoints?
Bitmap checkpoints are affected by screen resolution and image size.

25) What is File Content Checkpoint in UFT?As the name say "File Content" Checkpoint are used to check the contents of the file. The following file contents can be checked using this check point
•    PDF Files
•    RFT Files
•    WinWord Files
•    Text Files
•    HTML Files

26) What is Parameter & why parametrization?
A parameter is a variable that is assigned a value from an external data source at run time. We use parameterization when we want to change the value of properties at run time. It replaces a recorded input value in the script. The process by which the scope of a basic test is expanded by replacing fixed values with Parameters is known as Parameterization. It greatly increases the power and flexibility of tests.   
Why Parameterization
•    To test boundary conditions.
•    To test good data and "bad" data.

27) Why do we use breakpoints in UFT?
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.

28) 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.

29) 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.

30) What are the types of Automation Framework in UFT?
In order to ease the process of test automation using UFT, test automation is designed.  There are mainly three types of automation frameworks in UFT

•    Keyword Driven Framework: It is used when multiple functionality needs to be tested.
•    Data Driven Framework: It is used to test same flow with different test data, test data is given more importance than multiple functionality of application
•    Hybrid Framework: It is a combination of data driven framework and keyword.

31) 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.

32) 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.

33) What is a Run-Time Data Table? Where can I find and view this table?
Data like parametrized output, checkpoint values,and output values are stored in the Run-time Table. It is an xls file which is stored in the Test Results Folder.  It can also be accessed in the Test Fusion Report.

34) What is the difference between check point and output value?
Check point is a verification point that COMPARES a current value for a specified property with the expected value for that property. Based on this comparison, it will generate a PASS or FAIL status.
An output value is a value captured during the test run and can be stored in a specified location like the Datable or even a variable. Unlike Checkpoints, no PASS/FAIL status is generated.

35) What is GetRoProperty?
GetRoProperty is a standard method provided by UFT to fetch property values of a run -time object.

36) What is “SetToProperty” and when to use it in UFT?
Settoproperty stands for set test object property.  You can use this property to change the object values at runtime.  You can edit the property values during the runtime, but the changes that are made are temporary.

37) In UFT how you can prevent the system from getting locked?
To prevent system getting locked, any of the two ways can be used
Create a simple vbs file having code to press numlock key and run that vbs file
Edit one registry key “DisableLockWorkstation =1” to disable locking

38) What is descriptive programming in UFT means?
Descriptive programming includes property name and property value.  Whenever UFT is facing difficulty in identifying objects from object repository, and instead the object is directly identified from the script is known as descriptive programming.

39) In UFT explain the difference between qfl and vbs files?
•    qfl is quick test function library file while vbs is Microsoft’s vbscript
•    qfl is a non-executable file while vbs is an executable file
•    To use file in UFT associate qfl file from test setting, while to include vbs file use “execute file statement”

40) How to create TSR file in UFT?
TSR means Test Shared Repository, it is created to share object repository.
To create TSR file, follow the steps
•    Open object repository
•    Go to file menu
•    Go to export local objects option and select it
After that, UFT will ask you to store .tsr file. Give the path and save.  This will create .tsr file in UFT

41) How to connect to QC in UFT?
To connect with QC, UFT provides the option to connect QC directly from UFT GUI.
•    Go to file menu
•    Select (QC) quality centre
•    You will be asked to - Enter QC URL
•    Enter user id, password and project
Following above steps will allow you to connect with QC, later on you can execute the tests from QC itself.

42) What is round function in UFT?
Round function in UFT is used to round the decimal
For example:
Mydecimal = 6.3433333
Roundedvalue= Round (Mydecimal, 3)
Print roundedvalue, it will print 6.343

43) How to find the total number of rows in the web table in UFT?
There are three ways which we can find the count of rows in the table in UFT
•    Using row countproperty of UFT web table object
•    Using GetROProperty of UFT
•    Using HTML DOM + UFT

44) Explain in what ways we can export data table to excel in UFT?
To export data-table to excel, there are two methods.
•    DataTable.Export (“C:\export.xls”)
•    DataTable.ExportSheet “C:\mysheet.xls” (If excel file does not exist, new file is created)

45) In data table sheet in UFT, how to read a value from the cell?
To read a value from the cell, we follow 2 step process
•    We set the row pointer in first step
•    In second step we define the parameter/column name from the sheet to read.
•    Example: For this example, we have set the row pointer to 2 in transaction sheet
Datatable.GetSheet (“Transactions”).SetCurrentRow (2)
Now, we have to specify that we want to read a value from the module_name column from the transaction sheet
 Print datatable.Value (“Module_Name, “Transactions”)

46) What are ordinal identifiers in UFT/ QTP?
The following are called Ordinal Identifiers in QTP / UFT
•    Index
•    Creation time
•    Location

47) What are environment variables in UFT/QTP?
Environment Variables are similar to that of Global Variables when COMPARED to traditional programming languages like "C".Environment Variable Names are case sensitive
Values of the Environment Variables can be accessible to all the Actions or functions or Tests and API using simple call
Environment ("EnvironmentVariableName") = "Value"

48) What are the different types of environment variables?
We have two type of Environment Variables
•    Built In
•    User Defined
•    User Defined - Internal
•    User Defined – External
 Built In Environment variables are predefined variables defined by QTP/UFT.  Example of these variables are:
Msgbox Environment ("OS")
Msgbox Environment ("LocalHostName")
User can also create custom environment variables apart from the built-in environment variables. These variables are called User-defined Environment variables.Calling user defined variable is no different from built in environment variables.
Example: Msgbox Environment("ProjectName")

49) What is AOM (Automation Object Model)?
•    You can use UFT Object Model to write programs that automate your UFT operations. The UFT Automation Object Model provides objects, methods, and properties that enable you to control UFT from another application.
•    You can now control virtually every UFT feature and capability using the objects, methods and properties included in the UFT Automation Object Model.
•    You can write an automation script to run a selected batch of tests. For each test, you can retrieve the associated add-ins list. Then, if the necessary add-ins are not already loaded, you can close UFT, load the necessary add-ins, reopen UFT and run the test.
•    You can define your settings for a test in UFT then click “Generate Script” in the Generate tab of the Test Settings dialog box to generate an automation script based on the current test settings. You can then apply those same settings automatically to multiple tests using the whole automation script or excerpts from the generated file.

50) How to handle exceptions in UFT?
In UFT Exceptional handling is done by using -
•    Recovery Scenarios
•    Using “On Error” statement
In Recovery scenario you have to define -
•    Triggered Events
•    Recovery steps
•    Post Recovery Test-Run
At Script Level you can use the On Error Resume Next and On Error Go to 0 statements. 

51) What is a recovery scenario?
Recovery Scenario will be used in Recovering from Known Errors at Unknown intervals

The Following are the four Recovery Trigger Events
•    Popup Window
•    Object State
•    Test Run Error
•    Application Crash
Recovery Scenario will activate once an error has occurred and after error occurs Recovery Scenario will trigger and execute the Recovery activity. After Recovery Activity is completed, Post Recovery scenario will Occurs.

The following are post Recovery Scenario Operations
•    Repeat Current Step and Continue
•    Proceed to next Step
•    Proceed to Next Action Iteration
•    Proceed to Next test Iteration
•    Restart Current Test Run
•    Stop the test run


Post a Comment