Which environments are supported by QTP?
QTP supports the following environments
Web, Java (Core and Advanced), .Net, WPF, SAP, Oracle, Siebel, PeopleSoft, Delphi, Power Builder, Stingray 1, Terminal Emulator, Flex, Web Services, Windows Mobile, Visual Age Smalltalk, Silverlight and mainframe terminal emulator
Does QTP run in any environment?
No, QTP works only in the windows environment.
What are advantages of test automation?
- Time – It produces quick results
- No Manual intervention
- Cost effective
- Not prone to human errors
What are the types object Repositories in QTP?
QTP Supports 2 types of Object Repository
- Shared Object Repository (also called Global)
Shared Object Repository is preferable while dealing with dynamic objects which are called in multiple tests. The extension is “.tsr”
- Per-Action Object Repository, (also called Local)
Per-Action Object Repository is used by default. The extension for Per-Action repository is “.mtr”
What are various types of properties when using Object Identification in QTP?
QTP uses three types of properties when identifying an object
Mandatory Properties: Always learn these properties for the object
Assistive Properties: Learn in case Mandatory properties are not enough to identify the object uniquely
Ordinal Identifiers: Learn in case both mandatory and assistive properties are not able to recognize the objects correctly
Explain how QTP identifies object?
QTP identifies any GUI Object based on its corresponding properties. While recording, QTP will identify and store peculiar properties (as defined in the Object Identification settings) in the object repository of the GUI object. At run-time, QTP will compare the stored property values with the on-screen properties, to uniquely identify the GUI object.
How many types of recording modes in QTP?
QTP supports 3 types of recording modes
- Normal Mode: It is the default recording mode and takes full advantage of QTP’s Test Object Model. It recognizes objects regardless of their position on -screen. This is the preferred mode of recoding and is used for most of the automation activities.
- Low-level recording mode: This mode records the exact x, y co-ordinates of your mouse operations. It is helpful in testing hash maps. It is useful for recording objects not identified by normal mode of QTP.
- Analog mode: This mode records exact mouse and keyboard “movements” you perform in relation to the screen / application window. This mode is useful for the operation such as drawing a picture, recording signature., drag and drop operations.
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, Object Repository, Script and Datable will NOT be copied but a call (reference) would be made to the Action in the source script.
What is logical name of the object?
Logical name is a name given by QTP while creating an object in the repository to uniquely identify it from other objects in the application. This name would be used by the QTP to map the object name in script with its corresponding description in the object repository.
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.
Can we record an application running on a remote machine using QTP?
Yes, you can record remote application provided you are accessing application through the local browser not via remoter like citrix.
If you are still unable to record it is advisable install QTP and application, on the same machine.
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.
What is the file extension of the code file in QTP?
Code file extension is script.mts
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.
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.
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.
What are the various automation frameworks available in QTP?
Various types of automation frameworks available in QTP are
- Linear Scripting
- The Test Library Architecture Framework
- The Data Driven Testing Framework
- The Keyword Driven or Table Driven Testing Framework
- The Hybrid Test Automation Framework
How can you handle exceptions in QTP?
In QTP Exceptional handling is done by using
In Recovery scenario you have to define.
Triggered Events: Is an unexpected event like appearance of a Pop-up window, object state, test run error causing application crash or interruption in our running session
Recovery steps: Constitutes a series of steps required to be performed to enable QTP to proceed further with the process of test after some trigger event has interrupted the run session.
Post Recovery Test-Run: Are a set of instructions designed to be provided to QTP on proceeding further with the test after some recovery operation has been carried out.
Using “On Error” statement
At Script Level you can use the On Error Resume Next and On Error Go to 0 statement.
What are the Parameters in QTP?
There are two types of parameters like:
- Test parameters
- Action parameters
What are the types of environment variables in QTP?
Environment variables in QTP are of three types:
- Built-in (Read only)
- User-defined Internal (Read only)
- User-defined External (Read/Write)
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.
What is the difference between functions and actions in QTP?
Functions is a VB Script programming concept and do not have their own Object Repository or Data Table. Functions help in re-use of your code.
Ex: You can create a Function in your script to concatenate two strings.
Actions have their own Object Repository & Data Table. Actions help make your Test modular and increase reuse.
Ex: You can divide your script into Actions based on functionality like Login, Logout etc.
What is the difference between Excecute file and loadfunction library?
In execute file, we can’t debug the statements. With loadfunction library, statements can be debug and can also load multiple library files.
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.
What is keyword view and Expert view in QTP?
Keyword View is an icon based view which shows test steps in tabular format. It also automatically generates documentation for the test steps.
Expert View gives the corresponding VB Script statement for every test step in the Keyword view.
Explain QTP Testing process?
Create your test plan – This is preparatory phase where you identify the exact test steps, test data and expected results for you automated test. You also identify the environment and system configurations required to create and run your QTP Tests.
Recording a session on your application – During this phase, you will execute test steps one by one on your AUT, and QTP will automatically record corresponding VB script statements for each step performed.
Enhancing your test – In this stage you will insert checkpoints, output values, parameterization, programming logic like if…else loops to enhance the logic of your test script.
Replay & Debug – After enhancements you will replay the script to check whether its working properly and debug if necessary.
Run your Tests – In this phase you will perform the actual execution of your Test Script.
Analyzing the test results – Once test run is complete, you will analyze the results in the Test Fusion report generated.
Reporting defects – Any incidents identified needs to be reported. If you are using Quality Center, defects can be automatically raised for failed tests in QTP.
What is the difference between exitaction and exititeration?
Exitaction is used when we want to exit from a particular action, while exititeration is used to exit from a particular action iteration of an action.
What are the different types of Test Automation Frameworks?
The types of Automation Frameworks are –
- Linear Scripting – Record & Playback
- The Test Library Architecture Framework.
- The Data-Driven Testing Framework.
- The Keyword-Driven or Table-Driven Testing Framework.
How would you connect to database using vbscript?
To connect to the database, you must know
- connection string of your server
- DNS name
You can code the database connectivity command directly or you can use the SQL Query tool provided by QTP.
What is QTP batch testing tool?
You can use the Batch testing tool to run multiple scripts. Once the scripts are added in the tool, it will automatically open the scripts and start executing them one after the other.
What is an Optional Step?
A step when declared optional is not mandatory to be executed. If the corresponding GUI object is present, QTP performs the operation on it. If the GUI object is not present, QTP bypasses the optional step and proceeds to execute the next step.
How will you declare a variable in QTP?
You declare using a DIM keyword. You assign value to the variable using the SET keyword.
What is GetROProperty?
GetROProperty is a standard method provided by QTP to fetch property values of a run -time object.
What are the steps involved in using GetROProperty?
To use GetROProperty it involves four steps
- Record the object on which you want to use the GetROProperty in Object Repository
- Identify the run time property for the recorded object which could be used
- To retrieve the identified run time property and store the value in a variable
- Use this value for further deductions
How would you export a Script from one PC to another in QTP?
We can make use of the “Generate Script” function available in Object Identification, Test Settings and Tools/Options tab to create a zip of the script at the source computer. These zip files then can be imported into QTP at the destination computer.
What is SetToProperty?
SetToProperty changes property of an object stored in the Object Repository. However, these changes are not permanent.
What is the standard timing delay for web based application in QTP?
The standard delay is 60 seconds. This is can be changed in Test Settings.
What is the Action Conversion Tool?
It is an in-built tool provided by QTP to convert Actions into Business Process Components.
What is the extension for a function library?
The extension is ‘.QFL’
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
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 center
- 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.
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
a. Keyword Driven Framework: It is used when multiple functionality needs to be tested.
b. 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.
c. Hybrid Framework: It is a combination of data driven framework and keyword.
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.
How to find the total number of rows in the webtable in UFT?
There are three ways which we can find the count of rows in the table in UFT
- Using rowcount property of UFT webtable object
- Using GetROProperty of UFT
- Using HTML DOM + UFT
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
What are the ways you can handle run time errors?
There are various ways to handle run time errors
- Using test settings
- Using on error statement
- Using err Object
- Using Exit Statement
- Recovery Scenarios
- Report Object
How to add Synchronisation points in QTP?
There are 4 ways through which we can add synchronisation points in QTP
Wait statement: This statement will pause the execution for x seconds until object comes up
Wait property: This method will wait until property of object takes particular value
Exist statement: This statement will wait until object becomes available
Sync method: The code will wait until browser page is completely loaded. For web application testing this method is used
Which Permissions Required to Run QTP?
Following file system permissions:
- Full read and write permissions for all the files and folders under the folder in which QTP is installed
- Full read and write permissions to the Temp folder
- Read permissions to the Windows folder and to the System folder
Following registry key permissions:
- Full read and write permissions to all the keys under
- Read and Query Value permissions to all the
HKEY_LOCAL_MACHINE and HKEY_CLASSES_ROOT keys