Thursday, April 2, 2009

QTP Interview Questions

Introduction
Quick Test Professional (QTP) is an automated functional Graphical User Interface (GUI) testing tool that allows the automation of user actions on a web or client based computer application.
GA_googleFillSlot("OneStopTesting-MidBanner");
It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test.
Contents:
Testing Process
Test Object Model
Object Repositories
Checkpoints
QTP Recording
Parameterizing Tests
Keyword View
Actions in QTP
VBScript in QTP

1. What are the Features & Benefits of Quick Test Pro (QTP 8.0)?
- Operates stand-alone, or integrated into Mercury Business Process Testing and Mercury Quality Center. Introduces next-generation zero-configuration Keyword Driven testing technology in Quick Test Professional 8.0 allowing for fast test creation, easier maintenance, and more powerful data-driving capability. Identifies objects with Unique Smart Object Recognition, even if they change from build to build, enabling reliable unattended script execution. Collapses test documentation and test creation to a single step with Auto-documentation technology. Enables thorough validation of applications through a full complement of checkpoints.
2. How to handle the exceptions using recovery scenario manager in QTP?
- There are 4 trigger events during which a recovery scenario should be activated. A pop up window appears in an opened application during the test run: A property of an object changes its state or value, A step in the test does not run successfully, An open application fails during the test run, These triggers are considered as exceptions.You can instruct QTP to recover unexpected events or errors that occurred in your testing environment during test run. Recovery scenario manager provides a wizard that guides you through the defining recovery scenario. Recovery scenario has three steps: 1. Triggered Events 2. Recovery steps 3. Post Recovery Test-Run
3. What is the use of Text output value in QTP? -
Output values enable to view the values that the application talks during run time. 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.
4. How to use the Object spy in QTP 8.0 version?
- There are two ways to Spy the objects in QTP: 1) Thru file toolbar, In the File Toolbar click on the last toolbar button (an icon showing a person with hat). 2) True Object repository 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.
5. How Does Run time data (Parameterization) is handled in QTP?
- You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.
6. What is keyword view and Expert view in QTP?
- Quick Testââ‚â„¢s Keyword Driven approach, test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round-trip synchronized with the Keyword View. Advanced testers can view and edit their tests in the Expert View, which reveals the underlying industry-standard VBScript that Quick Test Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.
7. Explain about the Test Fusion Report of QTP?
- Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.
8. Which environments does QTP support?
- Quick Test Professional supports functional testing of all enterprise environments, including Windows, Web,..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.
9. What is QTP?
- Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, Quick Test Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and.NET framework applications
10. Explain QTP Testing process?
- Quick Test testing process consists of 6 main phases:
11. Create your test plan
- Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
12. Recording a session on your application
- As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
13. Enhancing your test
- Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
14. Debugging your test
- If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
15. Running your test on a new version of your application
- You run a test to check the behavior of your application. While running, Quick Test connects to your application and performs each step in your test.
16. Analyzing the test results
- You examine the test results to pinpoint defects in your application.
17. Reporting defects
- As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.
18. Explain the QTP Tool interface.
- It contains the following key elements: Title bar, displaying the name of the currently open test, Menu bar, displaying menus of Quick Test commands, File toolbar, containing buttons to assist you in managing tests, Test toolbar, containing buttons used while creating and maintaining tests, Debug toolbar, containing buttons used while debugging tests. Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View — Toolbars — Debug. Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow. Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View — Toolbars — Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. Test pane, containing two tabs to view your test-the Tree View and the Expert View ,Test Details pane, containing the Active Screen. Data Table, containing two tabs, Global and Action, to assist you in parameterizing your test. Debug Viewer pane, containing three tabs to assist you in debugging your test-Watch Expressions, Variables, and Command. (The Debug Viewer pane can be opened only when a test run pauses at a breakpoint.) Status bar, displaying the status of the test
19. How does QTP recognize Objects in AUT?
- Quick Test stores the definitions for application objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by Quick Test), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the Quick Test script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.
20. What are the types of Object Repositories in QTP?
- Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, Quick Test automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an objectââ‚â„¢s property values in one action, you may need to make the same change in every action (and any test) containing the object.
21. Explain the check points in QTP?
- A checkpoint verifies that expected information is displayed in an Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP. A page checkpoint checks the characteristics of an Application. A text checkpoint checks that a text string is displayed in the appropriate place on an Application. An object checkpoint (Standard) checks the values of an object on an Application. An image checkpoint checks the values of an image on an Application. A table checkpoint checks information within a table on a Application. An Accessibilityy checkpoint checks the web page for Section 508 compliance. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your Web application. A database checkpoint checks the contents of databases accessed by your web site
22. In how many ways we can add check points to an application using QTP?
- We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).
23. How does QTP identify objects in the application?
- QTP identifies the object in the application by Logical Name and Class.
24. What is Parameterizing Tests?
- When you test your application, you may want to check how it performs the same operations with multiple sets of data. For example, suppose you want to check how your application responds to ten separate sets of data. You could record ten separate tests, each with its own set of data. Alternatively, you can create a parameterized test that runs ten times: each time the test runs, it uses a different set of data.
25. What is test object model in QTP?
- The test object model is a large set of object types or classes that Quick Test uses to represent the objects in your application. Each test object class has a list of properties that can uniquely identify objects of that class and a set of relevant methods that Quick Test can record for it. A test object is an object that Quick Test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and check the object during the run session.
26. What is Object Spy in QTP?
- Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected objectââ‚â„¢s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.
27. What is the Diff between Image check-point and Bit map Check point?
- Image checkpoints enable you to check the properties of a Web image. You can check an area of a Web page or application as a bitmap. While creating a test or component, you specify the area you want to check by selecting an object. You can check an entire object or any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component. You can also choose to save only the selected area of the object with your test or component in order to save disk Space. For example, suppose you have a Web site that can display a map of a city the user specifies. The map has control keys for zooming. You can record the new map that is displayed after one click on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly. You can create bitmap checkpoints for all supported testing environments (as long as the appropriate add-ins are loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.
28. How many ways we can parameterize data in QTP?
- There are four types of parameters: Test, action or component parameters enable you to use values passed from your test or component, or values from other actions in your test. Data Table parameters enable you to create a data-driven test (or action) that runs several times using the data you supply. In each repetition, or iteration, Quick Test uses a different value from the Data Table. Environment variable parameters enable you to use variable values from other sources during the run session. These may be values you supply, or values that Quick Test generates for you based on conditions and options you choose. Random number parameters enable you to insert random numbers as values in your test or component. For example, to check how your application handles small and large ticket orders, you can have Quick Test generate a random number and insert it in a number of tickets edit field.
29. How do u do batch testing in WR & is it possible to do in QTP, if so explain? - Batch Testing in WR is nothing but running the whole test set by selecting Run Test set from the Execution Grid. The same is possible with QTP also. If our test cases are automated then by selecting Run Test set all the test scripts can be executed. In this process the Scripts get executed one by one by keeping all the remaining scripts in Waiting mode.
30. If I give some thousand tests to execute in 2 days what do u do?
- Adhoc testing is done. It Covers the least basic functionalities to verify that the system is working fine.
31. What does it mean when a check point is in red color? what do u do?
- A red color indicates failure. Here we analyze the cause for failure whether it is a Script Issue or Environment Issue or a Application issue.
32. What is Object Spy in QTP?
- Using the Object Spy, you can view the properties of any object in an open application. You use the Object Spy pointer to point to an object. The Object Spy displays the selected objectââ‚â„¢s hierarchy tree and its properties and values in the Properties tab of the Object Spy dialog box.
33. What is the file extension of the code file & object repository file in QTP?
- Code file extension is.vbs and object repository is.tsr
34. Explain the concept of object repository & how QTP recognizes objects?
- 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 to 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.
35. What are the properties you would use for identifying a browser & page when using descriptive programming?
- Name would be another property apart from title that we can use.
36. Give me an example where you have used a COM interface in your QTP project?
- com interface appears in the scenario of front end and back end. for eg:if you r using oracle as back end and front end as VB or any language then for better compatibility we will go for an interface. of which COM will be one among those interfaces. Create object creates handle to the instance of the specified object so that we program can use the methods on the specified object. It is used for implementing Automation(as defined by Microsoft).
37. Explain in brief about the QTP Automation Object Model.
- Essentially all configuration and run functionality provided via the Quick Test interface is in some way represented in the Quick Test automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in Quick Test 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 Quick Test automation object model, along with standard programming elements such as loops and conditional statements to design your program.

38.How do you test Siebel Application using QTP?
In SWE section you need to add automation enable = True. Under the same time you need to use SWE Cmd = Auto On in the URL.
39. How many types of actions are there in QTP?
QTP supports three types of actions.
1) non re-usable actions
2) re usable actions
3) external actions.
40.How do you data drive an external spreed sheet?
Import from external spreed sheet file by selecting import then from file. Which imports a tabbed text file or a single sheet from an existing Microsoft excel file in to the table. The sheet you import replace all data in a currently selected sheet.
41. I want to open a notepad window without recording a test and I do not want to use system util. run command as well how do I do this?
Another alternative to open a notepad is to use shell object. Check out with the following example.
Dim a
set a = wscript.create object (”wscript.shell”)
a.run “notepad.exe”.
42. how many types of recording modes in QTP? Describe each type with an example
where we use them?

Three types of recording modes in QTP.
1) NORMAL
2) ANALOG MODE
3) LOW LEVEL RECORDING MODE.
43. How can we do the frame work in QTP?
Depending upon the project and client requirements.
44.Testing > QTP which features of QTP would you like improve? How would you go about implementing it?
We are not implementing any concept in QTP.
45.Explain how would you design the driver code for a keyboard based test script?
Test script prepare in QTP.
Keywords prepare in a excel sheet and objects description prepare in a notepad.
46.What is the file extension of shared object repository?
The shared object repository is .tsr extension.
47. How to handle java tree in QTP?
First of all we need to handle a java add- in to handle a java tree. In tools we have the object identification drop down list. There we have the java option to recognize the objects there select the tree option. Add the properties.
48. How to fetch test data from data base by using QTP?
In order to fetch test data from dat base we have to create a Adodb connection object to connect with data base. The syntax is create object (”Adodb.connectin”).
49. What is the procedure to test flash application using QTP?
Using multimedia add- in support.
50. If a error aoccur during the execution of QTP scropt? How can we handle it?
Using recovery scenario manager.
51. How to merge the object repository files?
Using a repository merge tool. It is available with QT Plus Tool.
52. Can we update the data base through QTP?
Yes. We can.
. How many tabs are available to view your test in a test pane and what are they?
Two. These are tree and expert.
53. What are the three main stages involved in testing with QTP?
Creating test , running tests , analyzing test.
54. Write a function to capture the pop-ups?
Here I am writing steps handle pop-up exceptions.
1) select the recovery scenario manager
2) press the new scenario
3) click next
4) select the pop up exceptions
5) select the pop window which we want to handle (capture) by clicking the spy button.
6) press next
7) select the specified options like key board or mouse operations press next
select the specified options click default or press enter
9) click next and uncheck add another recovery operation
10) click next and select proceed next step
11) click next and give the scenario name and description
12) click next and select add scenario to current test and add scenario to default settings. Click finish after word save that scenario.
55. What is meant by hot keys?
A hot keys or a combination of keys on a computer board when pressed performs a task. The specific task performed by a particular hot key where is by operating system or application. However , there are commonly _ used hot keys.
56. For a triangle (sum of two sides is greater than or equal to third side ), what is the minimal number of test cases required?
Generally, we will calculate the number of test cases that depends on the particular module and its complexity. Minimum number of test = ( number of outputs) multiply (1.6) ( approx calculation)
57. What are the flaws in water fall module and how overcome it?
Science testing comes at last stage , there are huge chances of defect multiplication, defects will be migrated to every stage wastage of human recourses and time delays are also introduced.
58. How does you test the web link which is changing dynamically?
This could be tested through the automated test tools like Rational Robot and Win Runner .
59. What is system testing ? And what are the different types of tests you perform in system testing?
System testing is a type of block box testing means testing the application. After the integration testing, usually will do testing. Functionality, regression and performance test comes under this.
60. How do we know about the build we are going to test? Where do you see this?
In the test plan we are going to have all details about who should test which test in a team which is given by team leader. According to that the entire group will do their testing.
61. What did you do as a team leader?
The roles of a leader,
1) before the project gets started, will conduct one team meeting and discuss briefly about the upcoming project.
2) will distribute the work among the team members and let them know which part of application they are going to test.
62. What test you perform mostly? Regression or Retesting in your testing process?
Retesting is a repeated execution of the test case which results in a fault, with the aim that fault occurred, Regression testing is the renewed testing of already tested program or part of that modification with the aim that the modified had.
63. With out using GUI map editor can we recognize the application in win runner?
With out using GUI map editor, we can recognize the application objects using a descriptive programming.
64.How does Run Time data ( Parameterization ) is handle in QTP?
You can then enter test data into data table, an integrated spreadsheet with the full functionality or excel, to manipulate test data sets and create multiple test iterations, with out programming, to expand test case coverage. Data can typed in or imported from data bases, spreadsheets or text files.
65. What is keyboard view and expert view in QTP?
Quick tests key board driven approach test automation experts have full access to the underlying test and object properties, via an integrated scripting and debugging environment that is round trip synchronized with the key bored view. Advance testers can view and edit their tests in expert view, which reveals the underlying industry standards vb script that QTP automatically generates. Any changes made in expert view are automatically synchronized with the keyboard view.
66. Explain about the test fusion report of QTP?
Once a tester runs a test, a test fusion report displays all the aspects of the test run a high level results over view, an expandable tree view of the test specifying exactly where application failures occurred, the test data used , applications screen shots per every step that highlight any discrepancies, and detailed explanation of each check point pass and failure, by combining test fusion reports with QTP you can share reports across an entire QA and development team.
67.To which environments does QTP supports?
QTP supports functional testing of all enterprise environments, including Windows, Web, .Net, Java, j2EE, SAP, Sieble, Oracle, Peoplesoft, Visual Basic, ActiveX, Mainframe terminal emulators and Web services.
68.What is QTP?
Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Teat enables you to test standard web objects and ActiveX controls. In addition to these environments QTP also enables you to test java applets and applications and multimedia objects on applications as well as standard windows applications, Visual Basic 6 applications and .Net framework applications
69.How QTP recognizes Objects in AUT?
Quick Test stores the definitions for applications objects in a file called the Object Repository. As you record your test, Quick Test will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name ( determined automatically by Quick Test), and will contain a set of properties ( type, name etc ) that uniquely identify each object.
Each line in the Quick Test script will contain a reference to the object that you interacted with a call to the appropriate method ( set, click,check) and any parameters for method ( such as the valve for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.
70.What are the types of Object Repositories in QTP?
Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new test.
The object repository per-action mode is the default setting.In this mode, Quick Test automatically creates an object repository file for each action in your test so
that you can create and run tests without creating, choosing, or modifying object repository files.However, if you do modify values in an object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.
71.Explain the Check Points in Qtp?
A checkpoint verifies that expected information is displayed in application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.
1. A page checkpoint checks the characteristics of Application.
2. A text checkpoint checks that a text string is displayed in the appropriate place on a Application.
3.An object checkpoint ( standard) checks the values of an object on a Application.
4.An image checkpoint checks the values of an image on a Application.
5.A table checkpoint checks information with in a table an a Application.
6. An accessibility check point checks the web page per Section 508 compliance
7. An XML checkpoint checks the contents of individual XML data files or XML documents that are part of your web applications.
8. A database checkpoint checks the contents of data bases accessed by you.
9. In how many ways we can add checkpoints to an application using QTP?
We can add check points while recording the application or we add after recording is completed using Active Screen (NOTE: to perform the second one the active screen must be enable while recording).
72. How does QTP identifies the object in the application?
QTP identifies the object in the application by logical name and class. For ex. the Edit box is identified by
Logical Name:PSOPTIONS_TIME20
Class:Web Edit
73.If an application name changes frequently that is while recording it has name “Window1″ and then while running it’s “Window2″, in this case how does QTP handles?
QTP handle those situations by “Regular Expressions”.
74.What is parameterizing tests?
When you test application, you may want to check how it performs the same operations with multiple set of data . For ex: suppose you want to check hoe your application responds to ten separate test of data. You could record ten separate tests, each with it’s own set of data. Alternatively you can create a parameterized test that runs ten times: each time the test run, it uses a different set of data.
75.what is test object model in QTP?
The object model is a large set of obkject types or classess that quick test uses to represent the objects in your applications. Each test object lcass has a list of properties that can uniquely identifiy objects of that class and a set of relevant methods that quick test can record for it .
A test object is an object that quick test creates in the test or component to represent the actual object in your application. Quick Test stores information about the object that will help it identify and checks the object during the run session. A run time object is the actual object in your websites or in the application on which methods are performed during the run session.
When you perform an operation on your application while you recording.
• Identifies the quick test test object classes that represents the objects on which you performed the operation and creates the appropriate the test objects.
• Reads the current value of the object properties in your application and stores the list of properties and values with the test object.
• Choose a unique name for the object generally using the values of one of its prominent properties.
• Records the operation that you performed on the object using the appropriate quick test test object method.
For Example, Suppose you click on a Find button with the following HTML source code:

Then quick test identified the objects that you clicks as a web button test object
It creates a web button object with the name find, and records the following properties and values for the find web button:
It also records that you performed a click method on the Web button.
Quick test displays your s step in the keyboard view like this:
Quick Test displays your step in the expert view like this:
Browser(”Mercury Interactive”) . Page(” Mercury Interactive”).Web button(”Find”).Click
76.What is Object Spy in QTP?
Using the object Spy you can view the properties of any object in open application. You can use the object spy pointer to pint to an object. The object spy displays the select object’s hierarchy tree and its properties and values in the properties tab of the object spy dialog box.
77. What is the difference between image check point and bitmap checkpoint?
Image check point enable due to check the properties of web page. You can check an area of a web page or application as a bitmap.
While creating a test of component, you specify the area you want to check by selecting an object you can check an entire object or an any area within an object. Quick Test captures the specified object as a bitmap, and inserts a checkpoint in the test or component.
You can also use to save the selected area of the object with your test or component in order to save disk space for example, suppose you have a website that can display a map of a city the user specify that map has control keys for zooming.
You can record the new map i.e displayed after one check on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create bitmap checkpoint, all supported testing environments (as long as the appropriate add-ins are loaded)
Note: The result of bitmap check point may be effected by factors such as OS, Screen Resolutions and color settings.
78. How many ways we can parameterize data in QTP?
There are four types of parameters
1. Test Action or Component Parameters enable you to use values passed from your test or component or values from other actions in your test.
2. Data Table parameters enable you to create a data driven test or an act.
That runs several times using the data you supply.In each repeation or iteration quick test uses a Different value from the data table.
3. Environment variable parameters enable you to use variable values from other sources during the run sessions. these may be values you supply, or values that QTP generates for you based on conditions and options you choose.
4. Random number parameters enable you to insert random numbers as values in your test or component.
For example, to check how your application handles small and large ticked orders, you can have QTP generate a random number and insert it in a number of tickets edit field.
79. How do you do Batch testing Winrunner and is it possible to do in QTP? If So, Explain?
Batch testing in Winrunner is nothing but running the whole test set by selecting “Run Test Set” from the “Execution Grid”. The same is possible with QTP also. If our test cases are automated then by selecting ” Run test Set” all the test scripts can be executed.
With this process the scripts get executed one by one keeping all the remaining scripts in “Waiting Mode”.
80. If I give some 1000 tests to execute in 2days what do you do?
Adhoc Testing is done. It covers the least basic functionalities to verify that the system is working fine.
81. What does it mean when a checkpoint is in red color? What do you do?
Red color indicates failure. Here we analyze the cause for the failure whether it is a script issue or environmental issue or a application issue.
82. What do you call the Window Testing Director test lab?“Execution grid” it is placed from where we run all the manual/automated scripts.
83. How do you create new test sets in test director?
Login to TD.
Click on “Test Lab” Tab.
Select the desired folder under which we need to create the test set.(Test sets can be grouped as per module).
Click on “New test set or Control N” Icon to create a test set.
84. How to import data from a “.XLS” file to data table during run time?
Data table .Import “…XLS filename…”
Datatable .Import sheet (FileName, SheetSource, SheetDest)
Datatable>Importsheet “C:\name.Xls”, 1, “name”
85. How to export data present in Database to an “.XLS” file?
Datatable .Export “…xls filename…”
86. How to get traceability matrix from TD?
87. How to import a test case present in “.XLS” file to TD under a test set?
88. How to attach a file to Test director?
89. What do you do to script when objects or removed from application?
90. Syntax for how to call one script from another? and syntax to call one action in another?

Run Action Action Name,[IterationMode, IterationRange, Parameters] here the actions becomes reusable on making this call to any action.
IterationRange string not always required. Indicates the rows for which action iterations will be performed. Valid only when the iterationMode is rnfinteration. Enter the row range (i.e “1.7″): or enter rngAll to run iterations on all rows.
If the actions called by the RunAction statement includes an ExitAction statement, the Run Action
Statement can return the value of the ExitActions Ret Val arguement.
91. How to export QTP results to an “.xls” file?
By default it creates an “XML” file and displays the results.
92. What are the Differences between QTP and Winrunner?
QTP is Object based scripting (VB) where as WR is TSL ( C based language) Scripting.
QTP supports “.Net” application automation not available in WR
QTP has “Active Screen” support which captures the application not available in WR.
QTP has “Data Table to store script values, variables which WR does not have.
Using a “point and click” capability you can easily interface with objects, their.
Definitions and create checkpoints after having record script without having.
To navigate back to that location in your application like you have to with WinRunner.
This greatly speeds up script development.
93. How to add a Run-time parameter data sheet?
Datatable.localsheet
The following example, uses the Local Sheet property to return the Local Sheet of the run time data table in order to add a parameter(column) to it.
My parameter = DataTable. LocalSheet.AddParameter(”Time”, “5.45″)
94. What scripting language is used in QTP?
VB scripting
95. Analyzing the Checkpoint results
Standard Checkpoint : By adding standard checkpoints to your checks or components, you can compare the expected values of objects properties to the object’s current values during the run session, if the results doesn’t match the check point fails.
96. How to create a Run-time property for an object?
97. Table and DataBase(DB) checkpoints

By adding Table checkpoints to your tests or components we can check that a specified value is displayed in a cell in a table on your application. By adding DB checkpoints to your tests or components you can check the contents of database accessed by your application. The Results displayed for table and database checkpoints are similar. When you run tests or components QTP compares the expected results of the checkpoints to the actual results of the run session, if the results do not match the checkpoint fails.
You can check that a specified value is displayed in a cell in a table by adding a table checkpoint to your test or component.
For ActiveX tables, you can also check the properties of the table objects. To add a table checkpoint you use the checkpoint properties of dialog box. Table checkpoints are supports for web and ActiveX applications as well as for variety of External Add-in environments.
You can use Database checkpoints in your tests or components to check databases accessed by your websites or application and to delete defects. You define a query on your database, and then you create a database checkpoint that checks the results of the query. Database checkpoints are supported for all environments supported by QTP by default as well as for variety of external Add-in environments.
There are two ways to define a database query.
a. Use Microsoft Query. you can Install Microsoft Query from the custom installation of Microsoft office.
b. Manually define an Sql statement.
The checkpoints time out option is available only when creating a table checkpoint.
That is not available when creating a database checkpoints.
98. Checking Bitmaps.
You can check an area of a web page or application as bitmap. While creating a test or a components you specify the area you want to check by selecting an object. You can check an entire object or any area with in an object. QTP captures the specified object as bit map and inserts a checkpoint in the test or component.
You can also choose to save only the selected area of the object with your test or component in order to save disk space.
When you run the test or component QTP compares the object or selected area of the object currently displayed of the web page or the application with the bitmap stored when the test or component was recorded. If there are any differences QTP captures bitmap of the actual object and displays it with the expected bitmap in the details portion of the test results window.
By comparing the two bitmaps(Expected and Actual) you can identify the nature of the discrepancy for more information on the test results of a checkpoint, see viewing checkpoint results.
For example, suppose you have a website that can display a map of a city the user specify that map has control keys for zooming.
You can record the new map i.e displayed after one check on the control key that zooms in the map. Using the bitmap checkpoint, you can check that the map zooms in correctly.
You can create bitmap checkpoint, all supported testing environments (as long as the appropriate add-ins are loaded)
Note: The result of bitmap check point may be effected by factors such as OS, Screen Resolutions and color settings.
97. Text/Text area checkpoint
In the Text/Text area checkpoint propertied dialog box, you can specify the text to be checked as well as which text is displayed before and after the checked text. These configuration options are particularly helpful when the text string you want to check appears several times or when it could change in a predictable way during the run session
Note: In windows based environment. If there is more than one line of text selected, the checkpoint summary pane display (complex value ) instead of the selected text for the checkpoint.
QTP automatically displays the checked text in red and the text before and after the checked text in blue.
For text area checkpoints only the text string captured from the defined area is displayed(Text before and text after are not displayed)
To designate the parts of the captured string as checked text and other parts as text before and text after, click configure button.
The configure text selection dialog box opens.
Checking XML : XML (Extensible Markup language)is a Meta-Markup language for test documents i.e endorsed as a standard by the WC3.XML makes the complex data structure portable between different computer environments or operating systems and programming languages, facilitating the sharing of data.
XML files contain text with simple tags that describe the data within an XML documents these describe the data content, but not the presentation of the data.
Application that display and XML documents or file use either cascading style sheets of the XSL formatting objects(XSL-FO) to present the data.
You can verify the data content of XML files by inserting XML checkpoints. A few common uses of XML checkpoints are described below
An XML file can be a static data file i.e accessed in order to retrieve commonly used data for which a quick response time is needed. For example, country names, zip codes or area codes although this data can be changes over time it is normally quite static.
You can use an XML checkpoint to validate that the data has not changed from one application released to another.
An XML file can consists of elements with attributes and values(character data).
There is parent and child relationship between the elements, and elements can have attributes associated with them. If any part of the structure(including data) changes the applications ability to process the XML file may be effected. Using an XML checkpoint you can check the content of an element to make sure that its, attributes, and values have not changed.
XML files are often an intermediary that retrieves dynamically changing data from 1 system.
The data is then accessed by another system using document type definitions(DTD) enabling the accessing system to read and display the information in the file. You can use an xml checkpoint and parameterize the captured data values in order to check an xml document or file whose data changes in a predictable way.
XML documents and files often needed a well defined structure in order to be portable across platforms and development systems. One way to accomplish elements this is by developing and XML scheme which describes the structure of XML elements and data types. You can use scheme validation to check that each item of content in an xml file adheres to the scheme description of the elements in which the content is to be placed.

98.Object Repository types, which and when to use?
Deciding which object repository mode to choose the default object repository mode and appropriate object repository mode for each test, you need to understand the differences between the two modes.
In general; the object repository per action mode is easiest to use when you r creating simple recored and run tests, especially under the following conditions.
You have only one or very few, tests that correspond to a given application interface or set of objects.
You do not expert to frequently modify test object properties. You generally create single action tests conversely, the shared object repository mode is generally the preferred mode when you have several test that test elements of the same application, interface or set of objects.
you expert the object properties in your application to change from time to time and / or you regularly need to up date or modify test object properties.
You often work with multi action tests and regularly use insert copy of action and insert called to action options.

99. Can we script any test case with out having object repository ? or using object repository is a must?
No. You can script with out object repository by knowing the window handlers, spying and recognizing the objects logical names and properties available.

100. How to execute a WR script in QTP?
a)TSL tset.run test, test path, test set.[parameters]–>used in QTP 6.0 for backward compatibility.
Parameters:the test set with in quality center, in which test runs are stored. Note that this argument is relevant only when working with a test in a quality center project.When the test is not saved in a quality center, this parameter is ignored. Ex . TSL test.run test “D:\Tset1″
B) TSL test.runtestex testpsth,run minimize, close app [parameter] TSL test.runtestex “C:\Win Runner/Tests/Basic_Flight”,True,False,”My Value”.
Close App:indicates whether to close the WR application when the WR tset run ends.
Parameter: up to 15 WR function argument.

101.How to handle time errors?
On Error Resume next:causes execution to continue with the statement immediately following the statement that causes the run time error, or with the statement immediately following tie most recent call out of the procedure containing the on error resumes next statement.
This allows execution to continue despite a run time error. you can then build the error handling routine inline with in the procedure using “Err” object MSG box “error no:” “&Err.no&”.”&Err.description” “&Err.source&Err.help context”.

102.How to change the run time value of property for an object?
Set to property changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set.

103. How to retrieve the property of an object?
Using GETRO property.

104. How to open any application during scripting?
Systemutil, object used to open and close applications and processes during a run session. A systemutil.run statement is automatically added to your test when you run an application from the start menu or the run dialog box while recording a test. Ex. sytemutil.run “notepad.exe”
systemutil.close descendant processes (closes all the processes open by QTP ).

105.Types of properties that QTP learns while recording?
Mandatory and assistive. In addition to recording the mandatory and assistive properties specified in the object identification dialog box, QTP can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object in numerical value that indicates it’s order relative to other objects with an otherwise identical description (objects that have the same vales foe all properties specified in the mandatory and assistive property list). This ordered value enable QTP to create a unique description when the mandatory and assistive properties are not sufficient to do so.

106.What is the extension of script and object repository files?
Object repository: .TSR, script: .MTS, Excel: default.ELS

107. How to suppress warning from the test result page?
From the test result viewer “tools > filters > warnings ” must be unchecked.

108.When we try to use test run option run from step, the browser is not launching automatically? Why?
This is default behavior.

109. Does QTP is unicode compatible ?
QTP 6.5 is not but QTP 8.0 is expected to be Unicode compatible by end of Dec 2004.

110.How to turn off QTP results after running a script?
Go to tools > option > run tab and deselect view results when run session ends. But this suppresses only the result window, but a log will be created and can viewed manually which can not be restricted from getting created.

111.How to get font size of a web edit?

112. Is there any way to automatically update the data source name in data base checkpoints object when we migrate test to a new release?

113. How to verify the cursor focus of a certain field?
Use focus property of GETRO property method

114.Any limitation to XML check points ?

Mercury has determined that 1.4mb is the maximum size of XML file that QTP 6.5 can handle.

115. How to make arguments optional in a function?
This is not possible as default VBS does not support this. Instead you can pass a blank scoring and have a default value if arguments are not required.

116. How to convert a sting to an integer?
CInt ()—> a conversion function available.

117. Inserting a call to action is not importing all columns in data table of global sheet. Why?
Inserting a call to action will only import the columns of the action called.

2 comments:

eVision Infotech said...

Good Blog ...Really useful information related QTP.
Thanks Shekar

Jannik Andrew said...

Thank you For collecting QTP Interview Questions and The Tutorials On Your Blog are Awosme, It will be Most Usefull For Fresher and Students

QTP Online Training | Advanced QTP Online Training | Automation Testing Online Training | HP QTP Online Training