SlideShare a Scribd company logo
QTP 11 Certification Exam Details:
o Exam type: Objective (Multiple Choice)
o Exam Duration: 105 Minutes
o Number of Questions (items): 72
 Pass percentage: 75%

In the exam guide of HP0-M47 it is written :
"HP QuickTest Professional Add-ins Guide Chapter 38, Pages 623-631, 659-660, and 665-667 Chapter 39,
Pages 675-683"
Syllabus for QTP 11 (HPO- M47) Certification
Exam
SNO Sections Percentage
of Items
I) Automated Test Planning 10%
II) Creating Basic Tests and
Working with Objects
19%
III) Test Verification &
Enhancements
24%
IV) Modular automated test builds 11%
V) QTP and ALM integration 7%
VI) Automated test troubleshooting 10%
VII) Advanced QTP Scripting 4%
VIII) Expert View 7%
IX) Web applications 8%
Detailed Syllabus
I) Automated Test Planning
o Plan for Test Automation.
o Plan for QTP testing.
o Identify and describe features and settings.
o Explain QTP licensing and packaging.
II) Creating Basic Tests and Working with Objects
o Create the basic test.
o Explain how QTP works with objects.
o Add steps without recording.
o Object Identification Configuration and Smart Identification
III) Test Verification & Enhancements
o Add Checkpoints
o Enhance tests with parameters.
o Define Test results
o View test results.
IV) Modular automated test builds
o Build Modular Tests using Actions
o Using Shared Object Repositories.
V) QTP and ALM integration
o Explain the QTP/ALM connection.
o Define ALM management of QTP resources.
o Explain versioning features in QTP
VI) Automated test troubleshooting
o Troubleshoot Object Recognition problems.
o Use Recovery scenarios.
o Use the Debugging Tool.
o Measure System Performance.
o Configure log tracking
VII) Advanced QTP Scripting
o Import and export Excel sheets.
o Get and set object properties.
o Using Programmatic Descriptions to bypass repository.
VIII) Expert View
o Features of Expert View
o Describe dynamic object programming.
o Identify and describe VBScript elements.
IX) Web applications
o Recognize Web Add-in Extensibility.
o Describe Web event recording use and configuration.
o Identify new web testing capabilities.
------------------------------------------------------------
Note: Maximum items (Questions) on QTP Tool features only, Less / no importance for
Scripting logic (VB Script). Industry point of view and Product Understanding point view
Certification is useful, but work point of limited use only.
In order to get certification -
o Explore all Tool Menus and remember QTP commands and Shortcut keys
o Read HP QTP Documentation
o Collect Exam papers dumps and Practice
o Practice Tool features
Model Questions
1) You can view _________ while working with keyword view.
A. Object properties
B. Action properties
C. Action call properties
D. Checkpoint properties
E. Output value properties
F. None of the above
G. All of above
2) You cannot manage some aspects of a local object repository using the
QuickTest Object Repository automation object model.
A. True
B. False
3) For each action, you can use a combination of objects from your local and
shared object repositories.
A. True
B. False
4) QuickTest adds all new objects to the local object repository even if one or
more shared object repositories are already associated with the action assuming
that an object with the same description does not already exist in one of the
associated shared object repositories.
A. True
B. False
5) If a child object is added to a local object repository, and its parents are in a
shared object repository, then you have to manually drag and drop its parent
objects from shared object repository to local object repository.
A. True
B. False
6) The ________ is not accessible as a separate file
A. Local object repository
B. Shared object repository
C. Both
D. None
7) You can use the Keyword View to add a step ___________ in your test.
A. At the end
B. Below the currently selected step
C. At the beginning
D. At any point
8) The Documentation cell is ___________.
A. Read-only
B. Write-only
C. Read and Write
D. Read write & execute
9) An Item column can be any of the following:
A. A test object
B. A statement like Dim
C. A step generated by step generator
D. All of above
10) The Operation cell in the keyword view specifies the operation to be
performed on the item listed in the ___________ Column.
A. Operation
B. Documentation
C. Item
D. Value
11) Even if the Item column in the Keyword View is displayed to the right of the
Operation column, you must still first select an item to view the list of available
operations in the Operation column.
A. True
B. False
Answers:
1) G
2) B
3) A
4) A
5) B
6) A
7) D
8) A
9) D
10) C
11) A
PaperSet 2
HP QTP Certification Practice Exam Questions Set 11
1. What is the default Identifier?
A. The Location.
B. The Object Id.
C. The Native Class.
D. The Index Number.
2. Which of the following is an example of missing resource?
A. An Object
B. Run Results.
C. A Regular Action.
D. An External Action.
3. What are the available Environment Types?
A. Built-In
B. User-defined.
C. User-Function.
D. Built-In, User-Defined.
E. Built-In, User-Function.
4. How can you retrieve the number of items in the list of Web List object?
A. GetList.
B. GetItem.
C. GetItems Count.
D. GetROProperty.
5. What method is used to send run-time Data sheet to an excel sheet?
A. Send
B. Export
C. Sendsheet.
D. ExportSheet.
6. What does the GetROProperty method do?
A. Retrieves the value of a property from the test object.
B. Retrieves the available properties from a test object.
C. Retrieves the value of a property from a run time object.
D. Retrieves the available properties from a run time object.
7. What is the first thing that must be defined in a Recovery Scenario?
A. Trigger.
B. Recovery Operation.
C. Recovery Scenario Name.
D. The function used in the Scenario.
8. What does the source property of a database checkpoint object represent?
A. The SQL Query
B. The Identification number of the database.
C. The number of rows returned from the query.
D. The connectionstring used to connect to the database.
9. If a Procedure is defined in a test script, that procedure is accessible to which test/scripts?
A. Only to other procedures
B. It is not usable to any test scripts.
C. The test script in which it is defined.
D. Using the Step Generator, it is available to any test script.
10. Where do you set the action iterations for a specified action?
A. Action Settings
B. Action Properties.
C. Action Run Settings.
D. Action Call Properties.
11. How do you know if Smart Identification has been used in a test?
A. The Smart Identification icon appears in the test results.
B. The test results will show a run error, causing a test failure.
C. The Properties used by the object repository will be changed.
D. The object repository will show the Smart Identification Icon.
12. By default, how does Quick Test pass arguments to the procedure?
A. ByVal
B. ByRef
C. ByArg
D. ByRes
13. What looping statments are available in Quick Test?
A. Whileend, Doloop, Ifthen
B. Switchcase,ifthen, Fortext
C. Fortext, Whileend, Doloop.
D. Fortext, Doloop, Switchcase.
14. When does a Do loop statement evaluate for continuation?
A. At the end of the loop
B. At the start of the loop
C. At the Start or the end of the loop
D. This loop used a counter variable.
15. Where do you turn Smart Identification IN?
A. The Object Repository.
B. The Test Settings dialog.
C. The General Options dialog.
D. The object Identification dialog.
16. What are test object properties?
A. Those properties as defined in a description object.
B. Those properties as defined in Object identificaton.
C. Thos properties displayed by an object at run-time.
D. Those properties used in the object repository for object identification.
17. What are the two most commanly used ADO objects?
A. Fields
B. Execute
C. Connection, RecordSet
D. Open, ConnectionString
18. What is the function of Object Repository Manager?
A. Assign Variable names to the test objects
B. View/make/modify a Local Object Repository
C. View/make/modify a Shared Object Repository
D. Define new test objects using programmatic descriptions.
19. Which method for that Data utility object will allow you to retrieve information from the
Data Table during a test run?
A. Value
B. Import
C. GetCell
D. GetValue
20. When a procedure is created in the Function Library editor, what is the extension on the file?
A. .INI
B. .TXT
C. .QFL
D. .VBS
21. Where do you mark an action as reusable?
A. Action Settings
B. Action Properties
C. Action Run Settings
D. Action Call Properties
22. What is the keyword used to define how the counter variable in a or next loop increments?
A. ++
B. Next
C. Skip
D.Step
23. What does the ChildObjects method return?
A. A Collection object
B. A String True/False
C. A Boolean True/False
D. The number of objects matching the ChildObject description.
24. What are the available trigger event types?
A. Pop-up window, Object state, VBScript
B. Object State, VBScript event, Application crash
C. Pop-up window, object state, test run error, QTP crash
D. Pop-up window, object state, test run error, application crash.
25. What information can be seen in the information pane?
A. Syntax errors
B. The test name and author
C. The QTP license information.
D. The machine ID and operating system.
26. What are the available step commands in Quick Test?
A. Step.Step Into,Step Out
B. Step Into, Step Over, Step Out
C. Step Test, Step Action, Step Function
D. Run from Step, Debug from Step, Run from Step.
27. What are the categories in Step Generator?
A. Object, Operation, Value
B. Library, Built-in. Local Script.
C. Operation, Arguments, Return Value.
D. Test objects, Utility Objects, Functions
28. Where do you configure an action to use a shared object repository?
A. Test Settings
B. Action Settings
C. Action Call properties
D. Associate Repositories.
29. What options are available to filter objects in the Target Object Repository pane when
mergind object
repositories?
A. Show all objects or show only objects with conflicting object types
B. Show all objects or show only objects with conflicting descriptions.
C. Show only objects with conflicting logical names or show only objects with conflicting object
types.
D. Show only objects with conflicting logical names or show only objects with conflicting
descriptions.
30. What does a break point do?
A. Stops test execution at the specified step, after executing that step
B. Stops test execution at the specified step, before executing that step.
C. Pauses test execution at the specified step, after executing that step
D. Pauses test execution at the specified step, before executing that step.
31. In which command can you associate a function library to a test?
A. Run options
B. Test Settings
C. View Options
D. Function Definition Generator
32. To use low-level recording, what must you do first?
A. Start a new test
B. Be in the keyword view
C. Be recording in Normal Mode
D. Click Low Level recording under the Automation Menu
33. What method is used to retrieve the number of columns in the query results?
A. Field.Count
B. Fields.Item
C. Fieds.Count(BOF)
D. Fields.Count.Value
34. You should use local object repositories when you?
A. Work with single-action tests
B. Work with multiple-action tests
C. Create multiple tests for a single application.
D. Expect the test object properties to change frequently.
35. In Test Settings-->Run the Data Table iteration options are for which data sheet?
A. Local
B. Global
C. Run-time Data Table
D. Design-time data Table
Click here for more -->HP QTP certification sample questions
Answers
1. What is the default Identifier?
A. The Location.
2. Which of the following is an example of missing resource?
D. An External Action.
3. What are the available Environment Types?
D. Built-In, User-Defined.
4. How can you retrieve the number of items in the list of Web List object?
D. GetROProperty.
5. What method is used to send run-time Data sheet to an excel sheet?
D. ExportSheet.
6. What does the GetROProperty method do?
A. Retrieves the value of a property from the test object.
7. What is the first thing that must be defined in a Recovery Scenario?
A. Trigger.
8. What does the source property of a database checkpoint object represent?
A. The SQL Query
9. If a Procedure is defined in a test script, that procedure is accessible to which test/scripts?
C. The test script in which it is defined.
10. Where do you set the action iterations for a specified action?
D. Action Call Properties.
11. How do you know if Smart Identification has been used in a test?
A. The Smart Identification icon appears in the test results.
12. By default, how does Quick Test pass arguments to the procedure?
B. ByRef
13. What looping statments are available in Quick Test?
C. Fortext, Whileend, Doloop.
14. When does a Do loop statement evaluate for continuation?
C. At the Start or the end of the loop
15. Where do you turn Smart Identification IN?
D. The object Identification dialog.
16. What are test object properties?
D. Those properties used in the object repository for object identification.
17. What are the two most commanly used ADO objects?
C. Connection, RecordSet
18. What is the function of Object Repository Manager?
C. View/make/modify a Shared Object Repository
19. Which method for that Data utility object will allow you to retrieve information from the
Data Table during a test run?
A. Value
20. When a procedure is created in the Function Library editor, what is the extension on the file?
C. .QFL
21. Where do you mark an action as reusable?
B. Action Properties
22. What is the keyword used to define how the counter variable in a or next loop increments?
D.Step
23. What does the ChildObjects method return?
A. A Collection object
24. What are the available trigger event types?
D. Pop-up window, object state, test run error, application crash.
25. What information can be seen in the information pane?
A. Syntax errors
26. What are the available step commands in Quick Test?
B. Step Into, Step Over, Step Out
27. What are the categories in Step Generator?
D. Test objects, Utility Objects, Functions
28. Where do you configure an action to use a shared object repository?
D. Associate Repositories.
29. What options are available to filter objects in the Target Object Repository pane when
mergind object repositories?
B. Show all objects or show only objects with conflicting descriptions.
30. What does a break point do?
D. Pauses test execution at the specified step, before executing that step.
31. In which command can you associate a function library to a test?
B. Test Settings
32. To use low-level recording, what must you do first?
C. Be recording in Normal Mode
33. What method is used to retrieve the number of columns in the query results?
A. Field.Count
34. You should use local object repositories when you?
A. Work with single-action tests
35. In Test Settings-->Run the Data Table iteration options are for which data sheet?
B. Global
1. How Does Run time data (Parameterization) is handled in QTP?
A). 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.
2) What is keyword view and Expert view in QTP?
A) 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.
3) Explain about the Test Fusion Report of QTP?
A) Once a tester has run a test, a TestFusion 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
TestFusion reports with QuickTest Professional, you can share reports across an entire QA and
development team.
4) To which environments does a QTP support?
A) QuickTest 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.
5) What is QTP?
A) QuickTest 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, QuickTest 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.
6) Explain QTP testing process?
A) The QuickTest testing process consists of 6 main phases:
1. 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.
2. Recording a session on your application: As you navigate through your application, QuickTest
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.
3. 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.
4. Debugging your test: If changes were made to the script, you need to debug it to check that it
operates smoothly and without interruption.
5. Running your test on a new version of your application: You run a test to check the behavior
of your application. While running, QuickTest connects to your application and performs each
step in your test.
6. Analyzing the test results: You examine the test results to pinpoint defects in your application.
7. Reporting defects: As you encounter failures in the application when analyzing test results,
you will create defect reports in Defect Reporting Tool.
7) Explain the QTP Tool interface.
A) It contains the following key elements:
- Title bar, displaying the name of the currently open test
- Menu bar, displaying menus of QuickTest 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 QuickTest 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 QuickTest 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.
8) How QTP recognizes Objects in AUT?
A) QuickTest stores the definitions for application objects in a file called the Object Repository.
As you record your test, QuickTest will add an entry for each item you interact with. Each
Object Repository entry will be identified by a logical name (determined automatically by
QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each
object.
Each line in the QuickTest 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.
9) What are the types of Object Repository’s in QTP?
A) QuickTest 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, QuickTest
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.
10) Explain the check points in QTP?
A). A checkpoint verifies that expected information is displayed in a 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 a Application.
- A text checkpoint checks that a text string is displayed in the appropriate place on a
Application.
- An object checkpoint (Standard) checks the values of an object on a Application.
- An image checkpoint checks the values of an image on a Application.
- A table checkpoint checks information within a table on a Application.
- An Accessibility 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.
- Adatabase checkpoint checks the contents of databases accessed by your web site.
11) In how many ways we can add check points to an application using QTP. A) 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).
12) How does QTP identifies the object in the application?
A) QTP identifies the object in the application by Logical Name and Class.
13) If an application name is changes frequently i.e while recording it has name
"Window1" and then while running its "Windows2" in this case how does QTP handles?
A) QTP handles those situations using "Regular Expressions".
14) What is Parameterizing Tests?
A) 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.
15) What is test object model in QTP?
A) The test object model is a large set of object types or classes that QuickTest 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 QuickTest can record for it.
A test object is an object that QuickTest creates in the test or component to represent the actual
object in your application. QuickTest stores information about the object that will help it identify
and check the object during the run session.
A run-time object is the actual object in your Web site or application on which methods are
performed during the run session.
When you perform an operation on your application while recording, QuickTest identifies the
test object class that represents the object on which you performed the operation and creates the
appropriate test object reads the current value of the object's properties in your application and
stores the list of properties and values with the test object chooses a unique name for the object,
generally using the value of one of its prominent properties records the operation that you
performed on the object using the appropriate QuickTest test object method. For example,
suppose you click on a Find button with the following HTML source code:
<INPUT TYPE="submit" NAME="Find" VALUE="Find">
QuickTest identifies the object that you clicked as a WebButton test object. It creates a
WebButton object with the name Find, and records the properties and values for the Find
WebButton. It also records that you performed a Click method on the WebButton. QuickTest
displays your step like this:
Browser("Mercury Interactive").Page("Mercury Interactive").
WebButton("Find").Click
16) What is Object Spy in QTP?
A) 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.
17) What is the Diff between Image check-point and Bit map Check point?
A) 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. QuickTest 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 is
loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating
system, screen resolution, and color settings.
18) How many ways we can parameterize data in QTP?
A) 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, QuickTest 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 QuickTest 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 QuickTest generate a random number and insert it in a number of tickets edit field.
19. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
Ans: Batch Testing in WR is nothing but running the whole test set by selecting "Run Testset"
from the "Execution Grid". The same is possible with QTP also. If our test cases are automated
then by selecting "Run Testset" 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.
20. What does it mean when a check point is in red color? what do u do?
Ans : 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.
21. What do you call the window test director - testlab?
Ans : "Execution Grid". It is place from where we Run all Manual / Automated Scripts.
22. How does u create new test sets in TD?
Ans :
- 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 Ctrl+N" Icon to create a Test Set.
23. How do u do batch testing in WR & is it possible to do in QTP, if so explain?
Ans : You can use Test Batch Runner to run several tests in succession. The results for each test
are stored in their default location.
Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that
you can easily run the same batch of tests again, at another time. You can also choose to include
or exclude a test in your batch list from running during a batch run.
24. How to Import data from a ".xls" file to Data table during Runtime.
Ans :
- Datatable.Import "...XLS file name..."
- DataTable.ImportSheet(FileName, SheetSource, SheetDest)
- DataTable.ImportSheet "C:name.xls" ,1 ,"name"
25. How to export data present in Datatable to an ".xls" file?
Ans : DataTable.Export "....xls file name..."
26. Syntax for how to call one script from another and Syntax to call one "Action" in
another?
Ans: RunAction ActionName, [IterationMode , IterationRange , Parameters]
Here the actions become 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 rngIterations. Enter the row range (i.e. "1-7"),
or enter rngAll to run iterations on all rows.
If the action called by the RunAction statement includes an ExitAction statement, the RunAction
statement can return the value of the ExitAction's RetVal argument.
27. How to export QTP results to an ".xls" file?
Ans : By default it creates an "XML" file and displays the results.
28. Differences between QTP & Winrunner?
Ans :
- QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting.
- QTP supports ".NET" application Automation not available in Winrunner.
- 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 recorded a script without having to navigate back to that location
in your application like you have to with WinRunner. This greatly speeds up script development.
29. How to add a runtime parameter to a datasheet?
Ans: By using LocalSheet property. The following example uses the LocalSheet property to
return the local sheet of the run-time Data Table in order to add a parameter (column) to it:
MyParam=DataTable.LocalSheet.AddParameter("Time", "5:45")
30. What scripting language is QTP of?
Ans : VB Script.
31. Analyzing the Checkpoint results
Standard Checkpoint: By adding standard checkpoints to your tests or components, you can
compare the expected values of object properties to the object's current values during a run
session. If the results do not match, the checkpoint fails.
32. Table and DB Checkpoints: By adding table checkpoints to your tests or components, you
can check that a specified value is displayed in a cell in a table on your application. By adding
database checkpoints to your tests or components, you can check the contents of databases
accessed by your application.
The results displayed for table and database checkpoints are similar. When you run your test or
component, QuickTest compares the expected results of the checkpoint 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
object. To add a table checkpoint, you use the Checkpoint Properties dialog box.
Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of
external add-in environments.
You can use database checkpoints in your test or component to check databases accessed by your
Web site or application and to detect 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 QuickTest, by default, as
well as for a variety of external add-in environments.
There are two ways to define a database query:
- Use Microsoft Query. You can install Microsoft Query from the custom installation of
Microsoft Office.
- Manually define an SQL statement.
The Checkpoint timeout option is available only when creating a table checkpoint. It is not
available when creating a database checkpoint.
33. Checking Bitmaps:
A.) 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. QuickTest 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.
When you run the test or component, QuickTest compares the object or selected area of the
object currently displayed on the Web page or application with the bitmap stored when the test or
component was recorded. If there are differences, QuickTest captures a 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 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 is loaded).
Note: The results of bitmap checkpoints may be affected by factors such as operating system,
screen resolution, and color settings.
34. Text/Text Area Checkpoint: In the Text/Text Area Checkpoint Properties 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 run sessions.
Note: In Windows-based environments, if there is more than one line of text selected, the
Checkpoint Summary pane displays [complex value] instead of the selected text string. You can
then click Configure to view and manipulate the actual 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 parts of the captured string as Checked Text and other parts as Text Before and
Text After, click the Configure button. The Configure Text Selection dialog box opens.
35. Checking XML: XML (Extensible Markup Language) is a meta-markup language for text
documents that is endorsed as a standard by the W3C. XML makes the complex data structures
portable between different computer environments/operating systems and programming
languages, facilitating the sharing of data.
XML files contain text with simple tags that describe the data within an XML document. These
tags describe the data content, but not the presentation of the data. Applications that display an
XML document or file use either Cascading Style Sheets (CSS) or 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 that is 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 change over time, it is normally quite static. You can use an XML
file checkpoint to validate that the data has not changed from one application release to another.
- An XML file can consist of elements with attributes and values (character data). There is a
parent and child relationship between the elements, and elements can have attributes associated
with them. If any part of this structure (including data) changes, your application's ability to
process the XML file may be affected. Using an XML checkpoint, you can check the content of
an element to make sure that its tags, attributes, and values have not changed.
- XML files are often an intermediary that retrieves dynamically changing data from one 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 need a well-defined structure in order to be portable across
platforms and development systems. One way to accomplish this is by developing an XML
schema, which describes the structure of the XML elements and data types. You can use schema
validation to check that each item of content in an XML file adheres to the schema description of
the element in which the content is to be placed.
36. Object Repositories types, which & when to use?
A.) To choose the default object repository mode and the 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 are creating simple record 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 expect 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 tests that test elements of the same application, interface, or set of objects.
- You expect the object properties in your application to change from time to time and/or you
regularly need to update or modify test object properties.
- You often work with multi-action tests and regularly use the Insert Copy of Action and Insert
Call to Action options.
37. Can we Script any test case with out having Object repository? or Using Object
Repository is a must?
Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and
recognizing the objects logical names and properties available.
38. How to execute a WinRunner Script in QTP?
Ans :
(a) TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0 used for backward
compatibility
Parameters: The test set within 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 Quality Center , this parameter is ignored.
e.g : TSLTest.RunTest "D:test1", ""
(b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ]
TSLTest.RunTestEx "C:WinRunnerTestsbasic_flight", TRUE, FALSE, "MyValue"
CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run
ends.
Parameters : Up to 15 WinRunner function argument
39. How to handle Run-time errors?
Ans: On Error Resume Next : causes execution to continue with the statement immediately
following the statement that caused the run-time error, or with the statement immediately
following the most recent call out of the procedure containing the On Error Resume Next
statement. This allows execution to continue despite a run-time error. You can then build the
error-handling routine inline within the procedure. Using "Err" object msgbox "Error no: " & " "
& Err.Number & " " & Err.description & " " & Err.Source & Err.HelpContext
40. How to change the run-time value of a property for an object?
Ans : SetTOProperty 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.
41. How to retrieve the property of an object?
Ans : using "GetRoProperty".
42. How to open any application during Scripting?
Ans : 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
E.g : SystemUtil.Run "Notepad.exe"
SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP)
43. Types of properties that Quick Test learns while recording?
Ans : (a) Mandatory (b) Assistive .
In addition to recording the mandatory and assistive properties specified in the Object
Identification dialog box, QuickTest can also record a backup ordinal identifier for each test
object. The ordinal identifier assigns the object a numerical value that indicates its order relative
to other objects with an otherwise identical description (objects that have the same values for all
properties specified in the mandatory and assistive property lists). This ordered value enables
QuickTest to create a unique description when the mandatory and assistive properties are not
sufficient to do so.
44. What is the extension of script and object repository files?
Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls
45. How to supress warnings from the "Test results page"?
Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".
46. When we try to use test run option "Run from Step", the browser is not launching
automatically why?
Ans : This is default behaviour.
47. How to "Turn Off" QTP results after running a Script?
Ans : Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends".
But this supresses only the result window, but a og will be created and can viewed manulaly
which cannot be restricted from getting created.
48. How to verify the Cursor focus of a certain field?
Ans : Use "focus" property of "GetRoProperty" method"
49. How to make arguments optional in a function?
Ans : this is not possible as default VBS doesn't support this. Instead you can pass a blank scring
and have a default value if arguments r not required.
50. How to covert a String to an integer?
Ans : CInt()---> a conversion function available.
51. Inserting a Call to Action is not importing all columns in Datatable of globalsheet.
Why?
Ans : Inserting a call to action will only Import the columns of the Action called
52. How to get "FontSize" of a "WebEdit"?
53. Does QTP is "Unicode" compatible?
54. How to get "FontSize" of a "WebEdit"?
55. Is there anyway to automatically update the Datasource name in Database Checkpoints
object when we migrate tests to a new release?
56. Any limitation to XML Checkpoints?
57. What do you to script when objects are removed from application?
58. How to create a Runtime property for an object?
59. How to attach a file to TD?
Also See other Interview Questions:
 QTP - Interview Questions Part 2
 LoadRunner Interview Questions
 Manual Testing Interview Questions - 1
 Manual Testing Interview Questions - 2
1) What are the Features & Benefits of Quick Test Pro ?
Ans. 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?
Ans. 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:
 Triggered Events
 Recovery steps
 Post Recovery Test-Run
3) What is the use of Text output value in QTP?
Ans. 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?
Ans. There are two ways to Spy the objects in QTP:
 Thru file toolbar, In the File Toolbar click on the last toolbar button (an icon showing a
person with hat).
 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) Explain the concept of object repository & how QTP recognizes objects?
Ans. 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.
6) What are the properties you would use for identifying a browser & page when using
descriptive programming?
Ans. Name would be another property apart from title that we can use.
7) Give me an example where you have used a COM interface in your QTP project?
Ans. 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.
8) Explain in brief about the QTP Automation Object Model.
Ans. 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.
Introduction to Descriptive Programming.
How to write Descriptive Programming?
When and Where to use Descriptive programming?
Some points to note with Descriptive Programming.
Introduction to Descriptive Programming:
Descriptive programming is used when we want to perform an operation on an object that is not
present in the object repository. There can be various valid reason to do so. We will discuss them
later in this article.
How to write Descriptive Programming?
There are two ways in which descriptive programming can be used
1. By giving the description in form of the string arguments.
2. By creating properties collection object for the description.
1. By giving the description in form of the string arguments.
This is a more commonly used method for Descriptive Programming.
You can describe an object directly in a statement by specifying property:=value pairs describing
the object instead of specifying an object’s
name. The general syntax is:
TestObject("PropertyName1:=PropertyValue1", "..." , "PropertyNameX:=PropertyValueX")
TestObject—the test object class could be WebEdit, WebRadioGroup etc….
PropertyName:=PropertyValue—the test object property and its value. Each property:=value pair
should be separated by commas and quotation
marks. Note that you can enter a variable name as the property value if you want to find an
object based on property values you retrieve during a run session.
Consider the HTML Code given below:
<--!input type="”textbox”" name="”txt_Name”"-->
<--!input type="”radio”" name="”txt_Name”"-->
Now to refer to the textbox the statement would be as given below
Browser(“Browser”).Page(“Page”).WebEdit(“Name:=txt_Name”,”html tag:=INPUT”).set
“Test”
And to refer to the radio button the statement would be as given below
Browser(“Browser”).Page(“Page”).WebRadioGroup(“Name:=txt_Name”,”html
tag:=INPUT”).set “Test”
If we refer to them as a web element then we will have to distinguish between the 2 using the
index property
Browser(“Browser”).Page(“Page”).WebElement(“Name:=txt_Name”,”html
tag:=INPUT”,”Index:=0”).set “Test” ‘ Refers to the textbox
Browser(“Browser”).Page(“Page”).WebElement(“Name:=txt_Name”,”html
tag:=INPUT”,”Index:=1”).set “Test” ‘ Refers to the radio button
To determine which property and value pairs to use, you can use the Object Spy:
1. Go to Tools -> Object Spy.
2. Select the "Test Object Properties" radio button.
3. Spy on the desired object.
4. In the Properties list, find and write down the properties and values that can be used to identify
the object.
2. By creating properties collection object for the description.
Properties collection also does the same thing as string arguments. The only difference is that it
"collects" all the properties of a particular object in an instance of that object. Now that object
can be referenced easily by using the instance, instead of writing "string arguments" again and
again. It is my observation that people find "string arguments" [1] method much easier and
intuitive to work with.
To use this method you need first to create an empty description
Dim obj_Desc ‘Not necessary to declare
Set obj_Desc = Description.Create
Now we have a blank description in “obj_Desc”. Each description has 3 properties “Name”,
“Value” and “Regular Expression”.
obj_Desc(“html tag”).value= “INPUT”
When you use a property name for the first time the property is added to the collection and when
you use it again the property is modified. By default each property that is defined is a regular
expression. Suppose if we have the following description
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt.*”
This would mean an object with html tag as INPUT and name starting with txt. Now actually that
“.*” was considered as regular expression. So, if you want the property “name” not to be
recognized as a regular expression then you need to set the “regularexpression” property as
FALSE
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt.*”
obj_Desc(“name”).regularexpression= “txt.*”
This is how we create a description. Now below is the way we can use it
Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”
When we say .WebEdit(obj_Desc) we define one more property for our description that was not
earlier defined that is it’s a text box (because QTPs WebEdit boxes map to text boxes in a web
page).
If we know that we have more than 1 element with same description on the page then we must
define “index” property for the that description
Consider the HTML code given below
<--!input type="”textbox”" name="”txt_Name”"-->
<--!input type="”textbox”" name="”txt_Name”"-->
Now the html code has two objects with same description. So distinguish between these 2 objects
we will use the “index” property. Here is the description for both the object
For 1st textbox:
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”
obj_Desc(“index”).value= “0”
For 2nd textbox:
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”
obj_Desc(“index”).value= “1”
Consider the HTML Code given below:
<--!input type="”textbox”" name="”txt_Name”"-->
<--!input type="”radio”" name="”txt_Name”"-->
We can use the same description for both the objects and still distinguish between both of them
obj_Desc(“html tag”).value= “INPUT”
obj_Desc(“name”).value= “txt_Name”
When I want to refer to the textbox then I will use the inside a WebEdit object and to refer to the
radio button I will use the description object with the WebRadioGroup object.
Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” ‘Refers to the text box
Browser(“Browser”).Page(“Page”).WebRadioGroup(obj_Desc).set “Test” ‘Refers to the radio
button
But if we use WebElement object for the description then we must define the “index” property
because for a webelement the current description would return two objects.
Getting Child Object:
We can use description object to get all the objects on the page that matches that specific
description. Suppose we have to check all the checkboxes present on a web page. So we will first
create an object description for a checkboxe and then get all the checkboxes from the page
Dim obj_ChkDesc
Set obj_ChkDesc=Description.Create
obj_ChkDesc(“html tag”).value = “INPUT”
obj_ChkDesc(“type”).value = “checkbox”
Dim allCheckboxes, singleCheckBox
Set allCheckboxes = Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc)
For each singleCheckBox in allCheckboxes
singleCheckBox.Set “ON”
Next
The above code will check all the check boxes present on the page. To get all the child objects
we need to specify an object description.
If you wish to use string arguments [1], same thing can be accomplished by simple scripting.
Code for that would be:
i=0
Do While Browse(“Browser”).Page(“Page”).WebCheckBox("html
tag:=INPUT",type:=checkbox, "index:="&i).Exist
Browse(“Browser”).Page(“Page”).WebCheckBox("html tag:=INPUT",type:=checkbox,
"index:="&i).Set "ON"
i=i+1
Loop
Possible Operation on Description Objects
Consider the below code for all the solutions
Dim obj_ChkDesc
Set obj_ChkDesc=Description.Create
obj_ChkDesc(“html tag”).value = “INPUT”
obj_ChkDesc(“type”).value = “checkbox”
Q: How to get the no. of description defined in a collection
A: obj_ChkDesc.Count ‘Will return 2 in our case
Q: How to remove a description from the collection
A: obj_ChkDesc.remove “html tag” ‘would delete the html tag property from the collection
Q: How do I check if property exists or not in the collection?
A: The answer is that it’s not possible. Because whenever we try to access a property which is
not defined its automatically added to the collection. The only way to determine is to check its
value that is use a if statement “if obj_ChkDesc(“html tag”).value = empty then”.
Q: How to browse through all the properties of a properties collection?
A: Two ways
1st:
For each desc in obj_ChkDesc
Name=desc.Name
Value=desc.Value
RE = desc.regularexpression
Next
2nd:
For i=0 to obj_ChkDesc.count - 1
Name= obj_ChkDesc(i).Name
Value= obj_ChkDesc(i).Value
RE = obj_ChkDesc(i).regularexpression
Next
Hierarchy of test description:
When using programmatic descriptions from a specific point within a test object hierarchy, you
must continue to use programmatic descriptions
from that point onward within the same statement. If you specify a test object by its object
repository name after other objects in the hierarchy have
been described using programmatic descriptions, QuickTest cannot identify the object.
For example, you can use Browser(Desc1).Page(Desc1).Link(desc3), since it uses programmatic
descriptions throughout the entire test object hierarchy.
You can also use Browser("Index").Page(Desc1).Link(desc3), since it uses programmatic
descriptions from a certain point in the description (starting
from the Page object description).
However, you cannot use Browser(Desc1).Page(Desc1).Link("Example1"), since it uses
programmatic descriptions for the Browser and Page objects but
then attempts to use an object repository name for the Link test object (QuickTest tries to locate
the Link object based on its name, but cannot
locate it in the repository because the parent objects were specified using programmatic
descriptions).
When and Where to use Descriptive programming?
Below are some of the situations when Descriptive Programming can be considered useful:
1. One place where DP can be of significant importance is when you are creating functions in an
external file. You can use these function in various actions directly , eliminating the need of
adding object(s) in object repository for each action[If you are using per action object repository]
2. The objects in the application are dynamic in nature and need special handling to identify the
object. The best example would be of clicking a link which changes according to the user of the
application, Ex. “Logout <>”.
3. When object repository is getting huge due to the no. of objects being added. If the size of
Object repository increases too much then it decreases the performance of QTP while
recognizing a object. [For QTP8.2 and below Mercury recommends that OR size should not be
greater than 1.5MB]
4. When you don’t want to use object repository at all. Well the first question would be why not
Object repository? Consider the following scenario which would help understand why not Object
repository
Scenario 1: Suppose we have a web application that has not been developed yet.Now QTP for
recording the script and adding the objects to repository needs the application to be up, that
would mean waiting for the application to be deployed before we can start of with making QTP
scripts. But if we know the descriptions of the objects that will be created then we can still start
off with the script writing for testing
Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the
buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3
objects per page in the repository. For a 10 page flow this would mean 30 objects which could
have been represented just by using 3 objects. So instead of adding these 30 objects to the
repository we can just write 3 descriptions for the object and use it on any page.
5. Modification to a test case is needed but the Object repository for the same is Read only or in
shared mode i.e. changes may affect other scripts as well.
6. When you want to take action on similar type of object i.e. suppose we have 20 textboxes on
the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the
Object repository would not be a good programming approach.

More Related Content

Qtp 11 notes

  • 1. QTP 11 Certification Exam Details: o Exam type: Objective (Multiple Choice) o Exam Duration: 105 Minutes o Number of Questions (items): 72  Pass percentage: 75%  In the exam guide of HP0-M47 it is written : "HP QuickTest Professional Add-ins Guide Chapter 38, Pages 623-631, 659-660, and 665-667 Chapter 39, Pages 675-683" Syllabus for QTP 11 (HPO- M47) Certification Exam SNO Sections Percentage of Items I) Automated Test Planning 10% II) Creating Basic Tests and Working with Objects 19% III) Test Verification & Enhancements 24% IV) Modular automated test builds 11% V) QTP and ALM integration 7% VI) Automated test troubleshooting 10% VII) Advanced QTP Scripting 4% VIII) Expert View 7% IX) Web applications 8% Detailed Syllabus I) Automated Test Planning o Plan for Test Automation. o Plan for QTP testing.
  • 2. o Identify and describe features and settings. o Explain QTP licensing and packaging. II) Creating Basic Tests and Working with Objects o Create the basic test. o Explain how QTP works with objects. o Add steps without recording. o Object Identification Configuration and Smart Identification III) Test Verification & Enhancements o Add Checkpoints o Enhance tests with parameters. o Define Test results o View test results. IV) Modular automated test builds o Build Modular Tests using Actions o Using Shared Object Repositories. V) QTP and ALM integration o Explain the QTP/ALM connection. o Define ALM management of QTP resources. o Explain versioning features in QTP VI) Automated test troubleshooting o Troubleshoot Object Recognition problems. o Use Recovery scenarios. o Use the Debugging Tool. o Measure System Performance. o Configure log tracking VII) Advanced QTP Scripting o Import and export Excel sheets. o Get and set object properties. o Using Programmatic Descriptions to bypass repository. VIII) Expert View o Features of Expert View o Describe dynamic object programming.
  • 3. o Identify and describe VBScript elements. IX) Web applications o Recognize Web Add-in Extensibility. o Describe Web event recording use and configuration. o Identify new web testing capabilities. ------------------------------------------------------------ Note: Maximum items (Questions) on QTP Tool features only, Less / no importance for Scripting logic (VB Script). Industry point of view and Product Understanding point view Certification is useful, but work point of limited use only. In order to get certification - o Explore all Tool Menus and remember QTP commands and Shortcut keys o Read HP QTP Documentation o Collect Exam papers dumps and Practice o Practice Tool features Model Questions 1) You can view _________ while working with keyword view. A. Object properties B. Action properties C. Action call properties D. Checkpoint properties E. Output value properties F. None of the above G. All of above 2) You cannot manage some aspects of a local object repository using the QuickTest Object Repository automation object model. A. True B. False 3) For each action, you can use a combination of objects from your local and shared object repositories.
  • 4. A. True B. False 4) QuickTest adds all new objects to the local object repository even if one or more shared object repositories are already associated with the action assuming that an object with the same description does not already exist in one of the associated shared object repositories. A. True B. False 5) If a child object is added to a local object repository, and its parents are in a shared object repository, then you have to manually drag and drop its parent objects from shared object repository to local object repository. A. True B. False 6) The ________ is not accessible as a separate file A. Local object repository B. Shared object repository C. Both D. None 7) You can use the Keyword View to add a step ___________ in your test. A. At the end B. Below the currently selected step C. At the beginning D. At any point 8) The Documentation cell is ___________. A. Read-only B. Write-only C. Read and Write D. Read write & execute 9) An Item column can be any of the following: A. A test object B. A statement like Dim C. A step generated by step generator D. All of above 10) The Operation cell in the keyword view specifies the operation to be performed on the item listed in the ___________ Column. A. Operation
  • 5. B. Documentation C. Item D. Value 11) Even if the Item column in the Keyword View is displayed to the right of the Operation column, you must still first select an item to view the list of available operations in the Operation column. A. True B. False Answers: 1) G 2) B 3) A 4) A 5) B 6) A 7) D 8) A 9) D 10) C 11) A PaperSet 2 HP QTP Certification Practice Exam Questions Set 11 1. What is the default Identifier? A. The Location. B. The Object Id. C. The Native Class. D. The Index Number. 2. Which of the following is an example of missing resource? A. An Object B. Run Results. C. A Regular Action. D. An External Action. 3. What are the available Environment Types? A. Built-In B. User-defined. C. User-Function. D. Built-In, User-Defined.
  • 6. E. Built-In, User-Function. 4. How can you retrieve the number of items in the list of Web List object? A. GetList. B. GetItem. C. GetItems Count. D. GetROProperty. 5. What method is used to send run-time Data sheet to an excel sheet? A. Send B. Export C. Sendsheet. D. ExportSheet. 6. What does the GetROProperty method do? A. Retrieves the value of a property from the test object. B. Retrieves the available properties from a test object. C. Retrieves the value of a property from a run time object. D. Retrieves the available properties from a run time object. 7. What is the first thing that must be defined in a Recovery Scenario? A. Trigger. B. Recovery Operation. C. Recovery Scenario Name. D. The function used in the Scenario. 8. What does the source property of a database checkpoint object represent? A. The SQL Query B. The Identification number of the database. C. The number of rows returned from the query. D. The connectionstring used to connect to the database. 9. If a Procedure is defined in a test script, that procedure is accessible to which test/scripts? A. Only to other procedures B. It is not usable to any test scripts. C. The test script in which it is defined. D. Using the Step Generator, it is available to any test script. 10. Where do you set the action iterations for a specified action? A. Action Settings B. Action Properties. C. Action Run Settings. D. Action Call Properties. 11. How do you know if Smart Identification has been used in a test? A. The Smart Identification icon appears in the test results.
  • 7. B. The test results will show a run error, causing a test failure. C. The Properties used by the object repository will be changed. D. The object repository will show the Smart Identification Icon. 12. By default, how does Quick Test pass arguments to the procedure? A. ByVal B. ByRef C. ByArg D. ByRes 13. What looping statments are available in Quick Test? A. Whileend, Doloop, Ifthen B. Switchcase,ifthen, Fortext C. Fortext, Whileend, Doloop. D. Fortext, Doloop, Switchcase. 14. When does a Do loop statement evaluate for continuation? A. At the end of the loop B. At the start of the loop C. At the Start or the end of the loop D. This loop used a counter variable. 15. Where do you turn Smart Identification IN? A. The Object Repository. B. The Test Settings dialog. C. The General Options dialog. D. The object Identification dialog. 16. What are test object properties? A. Those properties as defined in a description object. B. Those properties as defined in Object identificaton. C. Thos properties displayed by an object at run-time. D. Those properties used in the object repository for object identification. 17. What are the two most commanly used ADO objects? A. Fields B. Execute C. Connection, RecordSet D. Open, ConnectionString 18. What is the function of Object Repository Manager? A. Assign Variable names to the test objects B. View/make/modify a Local Object Repository C. View/make/modify a Shared Object Repository D. Define new test objects using programmatic descriptions.
  • 8. 19. Which method for that Data utility object will allow you to retrieve information from the Data Table during a test run? A. Value B. Import C. GetCell D. GetValue 20. When a procedure is created in the Function Library editor, what is the extension on the file? A. .INI B. .TXT C. .QFL D. .VBS 21. Where do you mark an action as reusable? A. Action Settings B. Action Properties C. Action Run Settings D. Action Call Properties 22. What is the keyword used to define how the counter variable in a or next loop increments? A. ++ B. Next C. Skip D.Step 23. What does the ChildObjects method return? A. A Collection object B. A String True/False C. A Boolean True/False D. The number of objects matching the ChildObject description. 24. What are the available trigger event types? A. Pop-up window, Object state, VBScript B. Object State, VBScript event, Application crash C. Pop-up window, object state, test run error, QTP crash D. Pop-up window, object state, test run error, application crash. 25. What information can be seen in the information pane? A. Syntax errors B. The test name and author C. The QTP license information. D. The machine ID and operating system. 26. What are the available step commands in Quick Test? A. Step.Step Into,Step Out
  • 9. B. Step Into, Step Over, Step Out C. Step Test, Step Action, Step Function D. Run from Step, Debug from Step, Run from Step. 27. What are the categories in Step Generator? A. Object, Operation, Value B. Library, Built-in. Local Script. C. Operation, Arguments, Return Value. D. Test objects, Utility Objects, Functions 28. Where do you configure an action to use a shared object repository? A. Test Settings B. Action Settings C. Action Call properties D. Associate Repositories. 29. What options are available to filter objects in the Target Object Repository pane when mergind object repositories? A. Show all objects or show only objects with conflicting object types B. Show all objects or show only objects with conflicting descriptions. C. Show only objects with conflicting logical names or show only objects with conflicting object types. D. Show only objects with conflicting logical names or show only objects with conflicting descriptions. 30. What does a break point do? A. Stops test execution at the specified step, after executing that step B. Stops test execution at the specified step, before executing that step. C. Pauses test execution at the specified step, after executing that step D. Pauses test execution at the specified step, before executing that step. 31. In which command can you associate a function library to a test? A. Run options B. Test Settings C. View Options D. Function Definition Generator 32. To use low-level recording, what must you do first? A. Start a new test B. Be in the keyword view C. Be recording in Normal Mode D. Click Low Level recording under the Automation Menu 33. What method is used to retrieve the number of columns in the query results?
  • 10. A. Field.Count B. Fields.Item C. Fieds.Count(BOF) D. Fields.Count.Value 34. You should use local object repositories when you? A. Work with single-action tests B. Work with multiple-action tests C. Create multiple tests for a single application. D. Expect the test object properties to change frequently. 35. In Test Settings-->Run the Data Table iteration options are for which data sheet? A. Local B. Global C. Run-time Data Table D. Design-time data Table Click here for more -->HP QTP certification sample questions Answers 1. What is the default Identifier? A. The Location. 2. Which of the following is an example of missing resource? D. An External Action. 3. What are the available Environment Types? D. Built-In, User-Defined. 4. How can you retrieve the number of items in the list of Web List object? D. GetROProperty. 5. What method is used to send run-time Data sheet to an excel sheet? D. ExportSheet. 6. What does the GetROProperty method do? A. Retrieves the value of a property from the test object. 7. What is the first thing that must be defined in a Recovery Scenario? A. Trigger. 8. What does the source property of a database checkpoint object represent? A. The SQL Query 9. If a Procedure is defined in a test script, that procedure is accessible to which test/scripts?
  • 11. C. The test script in which it is defined. 10. Where do you set the action iterations for a specified action? D. Action Call Properties. 11. How do you know if Smart Identification has been used in a test? A. The Smart Identification icon appears in the test results. 12. By default, how does Quick Test pass arguments to the procedure? B. ByRef 13. What looping statments are available in Quick Test? C. Fortext, Whileend, Doloop. 14. When does a Do loop statement evaluate for continuation? C. At the Start or the end of the loop 15. Where do you turn Smart Identification IN? D. The object Identification dialog. 16. What are test object properties? D. Those properties used in the object repository for object identification. 17. What are the two most commanly used ADO objects? C. Connection, RecordSet 18. What is the function of Object Repository Manager? C. View/make/modify a Shared Object Repository 19. Which method for that Data utility object will allow you to retrieve information from the Data Table during a test run? A. Value 20. When a procedure is created in the Function Library editor, what is the extension on the file? C. .QFL 21. Where do you mark an action as reusable? B. Action Properties 22. What is the keyword used to define how the counter variable in a or next loop increments? D.Step 23. What does the ChildObjects method return? A. A Collection object
  • 12. 24. What are the available trigger event types? D. Pop-up window, object state, test run error, application crash. 25. What information can be seen in the information pane? A. Syntax errors 26. What are the available step commands in Quick Test? B. Step Into, Step Over, Step Out 27. What are the categories in Step Generator? D. Test objects, Utility Objects, Functions 28. Where do you configure an action to use a shared object repository? D. Associate Repositories. 29. What options are available to filter objects in the Target Object Repository pane when mergind object repositories? B. Show all objects or show only objects with conflicting descriptions. 30. What does a break point do? D. Pauses test execution at the specified step, before executing that step. 31. In which command can you associate a function library to a test? B. Test Settings 32. To use low-level recording, what must you do first? C. Be recording in Normal Mode 33. What method is used to retrieve the number of columns in the query results? A. Field.Count 34. You should use local object repositories when you? A. Work with single-action tests 35. In Test Settings-->Run the Data Table iteration options are for which data sheet? B. Global 1. How Does Run time data (Parameterization) is handled in QTP? A). 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. 2) What is keyword view and Expert view in QTP? A) 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
  • 13. 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. 3) Explain about the Test Fusion Report of QTP? A) Once a tester has run a test, a TestFusion 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 TestFusion reports with QuickTest Professional, you can share reports across an entire QA and development team. 4) To which environments does a QTP support? A) QuickTest 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. 5) What is QTP? A) QuickTest 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, QuickTest 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. 6) Explain QTP testing process? A) The QuickTest testing process consists of 6 main phases: 1. 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. 2. Recording a session on your application: As you navigate through your application, QuickTest 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. 3. 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
  • 14. 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. 4. Debugging your test: If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption. 5. Running your test on a new version of your application: You run a test to check the behavior of your application. While running, QuickTest connects to your application and performs each step in your test. 6. Analyzing the test results: You examine the test results to pinpoint defects in your application. 7. Reporting defects: As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool. 7) Explain the QTP Tool interface. A) It contains the following key elements: - Title bar, displaying the name of the currently open test - Menu bar, displaying menus of QuickTest 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 QuickTest 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 QuickTest 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.)
  • 15. - Status bar, displaying the status of the test. 8) How QTP recognizes Objects in AUT? A) QuickTest stores the definitions for application objects in a file called the Object Repository. As you record your test, QuickTest will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the QuickTest 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. 9) What are the types of Object Repository’s in QTP? A) QuickTest 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, QuickTest 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. 10) Explain the check points in QTP? A). A checkpoint verifies that expected information is displayed in a 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 a Application. - A text checkpoint checks that a text string is displayed in the appropriate place on a Application. - An object checkpoint (Standard) checks the values of an object on a Application. - An image checkpoint checks the values of an image on a Application. - A table checkpoint checks information within a table on a Application. - An Accessibility 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. - Adatabase checkpoint checks the contents of databases accessed by your web site. 11) In how many ways we can add check points to an application using QTP. A) We can add
  • 16. 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). 12) How does QTP identifies the object in the application? A) QTP identifies the object in the application by Logical Name and Class. 13) If an application name is changes frequently i.e while recording it has name "Window1" and then while running its "Windows2" in this case how does QTP handles? A) QTP handles those situations using "Regular Expressions". 14) What is Parameterizing Tests? A) 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. 15) What is test object model in QTP? A) The test object model is a large set of object types or classes that QuickTest 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 QuickTest can record for it. A test object is an object that QuickTest creates in the test or component to represent the actual object in your application. QuickTest stores information about the object that will help it identify and check the object during the run session. A run-time object is the actual object in your Web site or application on which methods are performed during the run session. When you perform an operation on your application while recording, QuickTest identifies the test object class that represents the object on which you performed the operation and creates the appropriate test object reads the current value of the object's properties in your application and stores the list of properties and values with the test object chooses a unique name for the object, generally using the value of one of its prominent properties records the operation that you performed on the object using the appropriate QuickTest test object method. For example, suppose you click on a Find button with the following HTML source code: <INPUT TYPE="submit" NAME="Find" VALUE="Find"> QuickTest identifies the object that you clicked as a WebButton test object. It creates a WebButton object with the name Find, and records the properties and values for the Find WebButton. It also records that you performed a Click method on the WebButton. QuickTest displays your step like this:
  • 17. Browser("Mercury Interactive").Page("Mercury Interactive"). WebButton("Find").Click 16) What is Object Spy in QTP? A) 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. 17) What is the Diff between Image check-point and Bit map Check point? A) 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. QuickTest 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 is loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings. 18) How many ways we can parameterize data in QTP? A) 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, QuickTest 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 QuickTest 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 QuickTest generate a random number and insert it in a number of tickets edit field. 19. How do u do batch testing in WR & is it possible to do in QTP, if so explain? Ans: Batch Testing in WR is nothing but running the whole test set by selecting "Run Testset" from the "Execution Grid". The same is possible with QTP also. If our test cases are automated then by selecting "Run Testset" all the test scripts can be executed. In this process the Scripts get
  • 18. executed one by one by keeping all the remaining scripts in "Waiting" mode. 20. What does it mean when a check point is in red color? what do u do? Ans : 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. 21. What do you call the window test director - testlab? Ans : "Execution Grid". It is place from where we Run all Manual / Automated Scripts. 22. How does u create new test sets in TD? Ans : - 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 Ctrl+N" Icon to create a Test Set. 23. How do u do batch testing in WR & is it possible to do in QTP, if so explain? Ans : You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location. Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run. 24. How to Import data from a ".xls" file to Data table during Runtime. Ans : - Datatable.Import "...XLS file name..." - DataTable.ImportSheet(FileName, SheetSource, SheetDest) - DataTable.ImportSheet "C:name.xls" ,1 ,"name" 25. How to export data present in Datatable to an ".xls" file? Ans : DataTable.Export "....xls file name..." 26. Syntax for how to call one script from another and Syntax to call one "Action" in another? Ans: RunAction ActionName, [IterationMode , IterationRange , Parameters] Here the actions become 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 rngIterations. Enter the row range (i.e. "1-7"), or enter rngAll to run iterations on all rows.
  • 19. If the action called by the RunAction statement includes an ExitAction statement, the RunAction statement can return the value of the ExitAction's RetVal argument. 27. How to export QTP results to an ".xls" file? Ans : By default it creates an "XML" file and displays the results. 28. Differences between QTP & Winrunner? Ans : - QTP is object bases Scripting ( VBS) where Winrunner is TSL (C based) Scripting. - QTP supports ".NET" application Automation not available in Winrunner. - 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 recorded a script without having to navigate back to that location in your application like you have to with WinRunner. This greatly speeds up script development. 29. How to add a runtime parameter to a datasheet? Ans: By using LocalSheet property. The following example uses the LocalSheet property to return the local sheet of the run-time Data Table in order to add a parameter (column) to it: MyParam=DataTable.LocalSheet.AddParameter("Time", "5:45") 30. What scripting language is QTP of? Ans : VB Script. 31. Analyzing the Checkpoint results Standard Checkpoint: By adding standard checkpoints to your tests or components, you can compare the expected values of object properties to the object's current values during a run session. If the results do not match, the checkpoint fails. 32. Table and DB Checkpoints: By adding table checkpoints to your tests or components, you can check that a specified value is displayed in a cell in a table on your application. By adding database checkpoints to your tests or components, you can check the contents of databases accessed by your application. The results displayed for table and database checkpoints are similar. When you run your test or component, QuickTest compares the expected results of the checkpoint 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 object. To add a table checkpoint, you use the Checkpoint Properties dialog box. Table checkpoints are supported for Web and ActiveX applications, as well as for a variety of external add-in environments.
  • 20. You can use database checkpoints in your test or component to check databases accessed by your Web site or application and to detect 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 QuickTest, by default, as well as for a variety of external add-in environments. There are two ways to define a database query: - Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office. - Manually define an SQL statement. The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint. 33. Checking Bitmaps: A.) 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. QuickTest 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. When you run the test or component, QuickTest compares the object or selected area of the object currently displayed on the Web page or application with the bitmap stored when the test or component was recorded. If there are differences, QuickTest captures a 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 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 is loaded). Note: The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings. 34. Text/Text Area Checkpoint: In the Text/Text Area Checkpoint Properties 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 run sessions.
  • 21. Note: In Windows-based environments, if there is more than one line of text selected, the Checkpoint Summary pane displays [complex value] instead of the selected text string. You can then click Configure to view and manipulate the actual 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 parts of the captured string as Checked Text and other parts as Text Before and Text After, click the Configure button. The Configure Text Selection dialog box opens. 35. Checking XML: XML (Extensible Markup Language) is a meta-markup language for text documents that is endorsed as a standard by the W3C. XML makes the complex data structures portable between different computer environments/operating systems and programming languages, facilitating the sharing of data. XML files contain text with simple tags that describe the data within an XML document. These tags describe the data content, but not the presentation of the data. Applications that display an XML document or file use either Cascading Style Sheets (CSS) or 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 that is 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 change over time, it is normally quite static. You can use an XML file checkpoint to validate that the data has not changed from one application release to another. - An XML file can consist of elements with attributes and values (character data). There is a parent and child relationship between the elements, and elements can have attributes associated with them. If any part of this structure (including data) changes, your application's ability to process the XML file may be affected. Using an XML checkpoint, you can check the content of an element to make sure that its tags, attributes, and values have not changed. - XML files are often an intermediary that retrieves dynamically changing data from one 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 need a well-defined structure in order to be portable across platforms and development systems. One way to accomplish this is by developing an XML schema, which describes the structure of the XML elements and data types. You can use schema validation to check that each item of content in an XML file adheres to the schema description of
  • 22. the element in which the content is to be placed. 36. Object Repositories types, which & when to use? A.) To choose the default object repository mode and the 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 are creating simple record 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 expect 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 tests that test elements of the same application, interface, or set of objects. - You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties. - You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options. 37. Can we Script any test case with out having Object repository? or Using Object Repository is a must? Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available. 38. How to execute a WinRunner Script in QTP? Ans : (a) TSLTest.RunTest TestPath, TestSet [, Parameters ] --> Used in QTP 6.0 used for backward compatibility Parameters: The test set within 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 Quality Center , this parameter is ignored. e.g : TSLTest.RunTest "D:test1", "" (b) TSLTest.RunTestEx TestPath, RunMinimized, CloseApp [, Parameters ] TSLTest.RunTestEx "C:WinRunnerTestsbasic_flight", TRUE, FALSE, "MyValue" CloseApp : Indicates whether to close the WinRunner application when the WinRunner test run ends. Parameters : Up to 15 WinRunner function argument
  • 23. 39. How to handle Run-time errors? Ans: On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using "Err" object msgbox "Error no: " & " " & Err.Number & " " & Err.description & " " & Err.Source & Err.HelpContext 40. How to change the run-time value of a property for an object? Ans : SetTOProperty 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. 41. How to retrieve the property of an object? Ans : using "GetRoProperty". 42. How to open any application during Scripting? Ans : 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 E.g : SystemUtil.Run "Notepad.exe" SystemUtil.CloseDescendentProcesses (Closes all the processes opened by QTP) 43. Types of properties that Quick Test learns while recording? Ans : (a) Mandatory (b) Assistive . In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so. 44. What is the extension of script and object repository files? Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls 45. How to supress warnings from the "Test results page"? Ans : From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked". 46. When we try to use test run option "Run from Step", the browser is not launching automatically why? Ans : This is default behaviour.
  • 24. 47. How to "Turn Off" QTP results after running a Script? Ans : Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created. 48. How to verify the Cursor focus of a certain field? Ans : Use "focus" property of "GetRoProperty" method" 49. How to make arguments optional in a function? Ans : this is not possible as default VBS doesn't support this. Instead you can pass a blank scring and have a default value if arguments r not required. 50. How to covert a String to an integer? Ans : CInt()---> a conversion function available. 51. Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why? Ans : Inserting a call to action will only Import the columns of the Action called 52. How to get "FontSize" of a "WebEdit"? 53. Does QTP is "Unicode" compatible? 54. How to get "FontSize" of a "WebEdit"? 55. Is there anyway to automatically update the Datasource name in Database Checkpoints object when we migrate tests to a new release? 56. Any limitation to XML Checkpoints? 57. What do you to script when objects are removed from application? 58. How to create a Runtime property for an object? 59. How to attach a file to TD? Also See other Interview Questions:  QTP - Interview Questions Part 2  LoadRunner Interview Questions  Manual Testing Interview Questions - 1  Manual Testing Interview Questions - 2 1) What are the Features & Benefits of Quick Test Pro ?
  • 25. Ans. 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? Ans. 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:  Triggered Events  Recovery steps  Post Recovery Test-Run 3) What is the use of Text output value in QTP? Ans. 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? Ans. There are two ways to Spy the objects in QTP:  Thru file toolbar, In the File Toolbar click on the last toolbar button (an icon showing a person with hat).
  • 26.  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) Explain the concept of object repository & how QTP recognizes objects? Ans. 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. 6) What are the properties you would use for identifying a browser & page when using descriptive programming? Ans. Name would be another property apart from title that we can use. 7) Give me an example where you have used a COM interface in your QTP project? Ans. 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. 8) Explain in brief about the QTP Automation Object Model.
  • 27. Ans. 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. Introduction to Descriptive Programming. How to write Descriptive Programming? When and Where to use Descriptive programming? Some points to note with Descriptive Programming. Introduction to Descriptive Programming: Descriptive programming is used when we want to perform an operation on an object that is not present in the object repository. There can be various valid reason to do so. We will discuss them later in this article. How to write Descriptive Programming? There are two ways in which descriptive programming can be used 1. By giving the description in form of the string arguments. 2. By creating properties collection object for the description. 1. By giving the description in form of the string arguments. This is a more commonly used method for Descriptive Programming. You can describe an object directly in a statement by specifying property:=value pairs describing the object instead of specifying an object’s name. The general syntax is: TestObject("PropertyName1:=PropertyValue1", "..." , "PropertyNameX:=PropertyValueX") TestObject—the test object class could be WebEdit, WebRadioGroup etc…. PropertyName:=PropertyValue—the test object property and its value. Each property:=value pair should be separated by commas and quotation marks. Note that you can enter a variable name as the property value if you want to find an object based on property values you retrieve during a run session.
  • 28. Consider the HTML Code given below: <--!input type="”textbox”" name="”txt_Name”"--> <--!input type="”radio”" name="”txt_Name”"--> Now to refer to the textbox the statement would be as given below Browser(“Browser”).Page(“Page”).WebEdit(“Name:=txt_Name”,”html tag:=INPUT”).set “Test” And to refer to the radio button the statement would be as given below Browser(“Browser”).Page(“Page”).WebRadioGroup(“Name:=txt_Name”,”html tag:=INPUT”).set “Test” If we refer to them as a web element then we will have to distinguish between the 2 using the index property Browser(“Browser”).Page(“Page”).WebElement(“Name:=txt_Name”,”html tag:=INPUT”,”Index:=0”).set “Test” ‘ Refers to the textbox Browser(“Browser”).Page(“Page”).WebElement(“Name:=txt_Name”,”html tag:=INPUT”,”Index:=1”).set “Test” ‘ Refers to the radio button To determine which property and value pairs to use, you can use the Object Spy: 1. Go to Tools -> Object Spy. 2. Select the "Test Object Properties" radio button. 3. Spy on the desired object. 4. In the Properties list, find and write down the properties and values that can be used to identify the object. 2. By creating properties collection object for the description. Properties collection also does the same thing as string arguments. The only difference is that it "collects" all the properties of a particular object in an instance of that object. Now that object can be referenced easily by using the instance, instead of writing "string arguments" again and again. It is my observation that people find "string arguments" [1] method much easier and intuitive to work with. To use this method you need first to create an empty description Dim obj_Desc ‘Not necessary to declare Set obj_Desc = Description.Create Now we have a blank description in “obj_Desc”. Each description has 3 properties “Name”, “Value” and “Regular Expression”.
  • 29. obj_Desc(“html tag”).value= “INPUT” When you use a property name for the first time the property is added to the collection and when you use it again the property is modified. By default each property that is defined is a regular expression. Suppose if we have the following description obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt.*” This would mean an object with html tag as INPUT and name starting with txt. Now actually that “.*” was considered as regular expression. So, if you want the property “name” not to be recognized as a regular expression then you need to set the “regularexpression” property as FALSE obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt.*” obj_Desc(“name”).regularexpression= “txt.*” This is how we create a description. Now below is the way we can use it Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” When we say .WebEdit(obj_Desc) we define one more property for our description that was not earlier defined that is it’s a text box (because QTPs WebEdit boxes map to text boxes in a web page). If we know that we have more than 1 element with same description on the page then we must define “index” property for the that description Consider the HTML code given below <--!input type="”textbox”" name="”txt_Name”"--> <--!input type="”textbox”" name="”txt_Name”"--> Now the html code has two objects with same description. So distinguish between these 2 objects we will use the “index” property. Here is the description for both the object For 1st textbox: obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name” obj_Desc(“index”).value= “0” For 2nd textbox: obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name”
  • 30. obj_Desc(“index”).value= “1” Consider the HTML Code given below: <--!input type="”textbox”" name="”txt_Name”"--> <--!input type="”radio”" name="”txt_Name”"--> We can use the same description for both the objects and still distinguish between both of them obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name” When I want to refer to the textbox then I will use the inside a WebEdit object and to refer to the radio button I will use the description object with the WebRadioGroup object. Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” ‘Refers to the text box Browser(“Browser”).Page(“Page”).WebRadioGroup(obj_Desc).set “Test” ‘Refers to the radio button But if we use WebElement object for the description then we must define the “index” property because for a webelement the current description would return two objects. Getting Child Object: We can use description object to get all the objects on the page that matches that specific description. Suppose we have to check all the checkboxes present on a web page. So we will first create an object description for a checkboxe and then get all the checkboxes from the page Dim obj_ChkDesc Set obj_ChkDesc=Description.Create obj_ChkDesc(“html tag”).value = “INPUT” obj_ChkDesc(“type”).value = “checkbox” Dim allCheckboxes, singleCheckBox Set allCheckboxes = Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc) For each singleCheckBox in allCheckboxes singleCheckBox.Set “ON” Next The above code will check all the check boxes present on the page. To get all the child objects we need to specify an object description.
  • 31. If you wish to use string arguments [1], same thing can be accomplished by simple scripting. Code for that would be: i=0 Do While Browse(“Browser”).Page(“Page”).WebCheckBox("html tag:=INPUT",type:=checkbox, "index:="&i).Exist Browse(“Browser”).Page(“Page”).WebCheckBox("html tag:=INPUT",type:=checkbox, "index:="&i).Set "ON" i=i+1 Loop Possible Operation on Description Objects Consider the below code for all the solutions Dim obj_ChkDesc Set obj_ChkDesc=Description.Create obj_ChkDesc(“html tag”).value = “INPUT” obj_ChkDesc(“type”).value = “checkbox” Q: How to get the no. of description defined in a collection A: obj_ChkDesc.Count ‘Will return 2 in our case Q: How to remove a description from the collection A: obj_ChkDesc.remove “html tag” ‘would delete the html tag property from the collection Q: How do I check if property exists or not in the collection? A: The answer is that it’s not possible. Because whenever we try to access a property which is not defined its automatically added to the collection. The only way to determine is to check its value that is use a if statement “if obj_ChkDesc(“html tag”).value = empty then”. Q: How to browse through all the properties of a properties collection? A: Two ways 1st: For each desc in obj_ChkDesc Name=desc.Name Value=desc.Value RE = desc.regularexpression Next 2nd: For i=0 to obj_ChkDesc.count - 1 Name= obj_ChkDesc(i).Name Value= obj_ChkDesc(i).Value RE = obj_ChkDesc(i).regularexpression Next
  • 32. Hierarchy of test description: When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions from that point onward within the same statement. If you specify a test object by its object repository name after other objects in the hierarchy have been described using programmatic descriptions, QuickTest cannot identify the object. For example, you can use Browser(Desc1).Page(Desc1).Link(desc3), since it uses programmatic descriptions throughout the entire test object hierarchy. You can also use Browser("Index").Page(Desc1).Link(desc3), since it uses programmatic descriptions from a certain point in the description (starting from the Page object description). However, you cannot use Browser(Desc1).Page(Desc1).Link("Example1"), since it uses programmatic descriptions for the Browser and Page objects but then attempts to use an object repository name for the Link test object (QuickTest tries to locate the Link object based on its name, but cannot locate it in the repository because the parent objects were specified using programmatic descriptions). When and Where to use Descriptive programming? Below are some of the situations when Descriptive Programming can be considered useful: 1. One place where DP can be of significant importance is when you are creating functions in an external file. You can use these function in various actions directly , eliminating the need of adding object(s) in object repository for each action[If you are using per action object repository] 2. The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. “Logout <>”. 3. When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object. [For QTP8.2 and below Mercury recommends that OR size should not be greater than 1.5MB] 4. When you don’t want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository Scenario 1: Suppose we have a web application that has not been developed yet.Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with making QTP scripts. But if we know the descriptions of the objects that will be created then we can still start off with the script writing for testing
  • 33. Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page. 5. Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well. 6. When you want to take action on similar type of object i.e. suppose we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach.