Thursday, February 4, 2010

QTP Interface

Introduction to QTP (QuickTest Professional)

The Mercury advanced keyword-driven testing solution

Launch QTP

When you Launch QTP, first it will display Addin Manager Window.
Addin Manager window giving information for all supporting technologies for your QTP.

Addin Manager Window


Technologies Supported
Default Support
1. Standard Windows applications
2. Web objects / Applications
3. ActiveX controls
4. Visual Basic applications

Additional QuickTest add-ins Support,
1. Java
2. Oracle
3. SAP Solutions,
4. .NET Windows
5. Web Forms,
6. Siebel,
7. PeopleSoft,
8. Web services,
and terminal emulator applications.

QTP’s Add-in Manager facilitates the users to select the technology / environment from variety of environments suitable for the AUT (Application Under Test)

Once an add-in is loaded, users can record that application in its supported environment and thus QTP recognizes the objects specific to the application under test (AUT) as loaded through Add-in Manager.

It is critical for the users to know the development technologies / environment of AUT, and load right Add-Ins while invoking Quick Test Pro

QTP Interface

Powered by website analytics technology.







QTP - Main Window

1) Test Pane:

Test Pane contains two labs to view the tests,
- Keyword View
- Expert View

Keyword View:



Quick Test Pro displays your test in the form of a collapsible, icon based tree…

Expert View:


Quick Test Pro displays the source code (VB Script) of the tests in this view.

2) Data Table :


Data table assists in Parameterizing the tests…

3) Debug Viewer Pane :



It assists in debugging tests with the help of Watch Expressions, Variables, and Command.

4) Active Screen Pane :

QTP Testing Process

Powered by website analytics technology.


The QTP (QuickTest Professional) testing process consists of the following main phases:

1. Analyzing your application
The first step in planning your test is to analyze your application to determine your testing needs.

What are your application's development environments (for example Web, Java, or .NET)? You will need load QTP add-ins for these environments to enable QTP to identify and work with the objects in your application.
What business processes and functionality do you want to test? To answer this, think about the various activities that customers perform in your application to accomplish specific tasks.
Consider how to divide these business processes into smaller units. You will be creating actions based on these tasks. Smaller and more modular actions make your tests easier to read and follow, and help ease maintenance in the long run.
At this stage, you can already begin creating test skeletons and adding actions to them.

2. Preparing the testing infrastructure
Based on your testing needs, you determine what resources are required and create these resources, accordingly. Resources include shared object repositories containing test objects (which are representations of the objects in your application), function libraries containing functions that enhance QTP functionality, and so on.

You also need to configure QTP settings so that QTP will perform the tasks you need, such as displaying a results report every time you run a test.

3. Building your tests and adding steps to them
After the testing infrastructure is ready, you can begin building your tests. You can create one or more empty tests and add actions to them to create the testing skeletons. You associate your object repositories with the relevant actions, and associate your function libraries with the relevant tests, so that you can insert steps using keywords. You may also need to configure test preferences at this point.

4. 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 determine whether your application is functioning correctly.

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 or loop statements enables you to add sophisticated checks to your test.

5. Debugging, running, and analyzing your test
You debug a test to ensure that it operates smoothly and without interruption. After the test is working correctly, you run it to check the behaviour of your application. While running, QTP opens the application and performs each step in your test.

You examine the test results to pinpoint defects in your application.

6. Reporting defects
If you have Quality Center installed, you can report the defects you discover to a database. Quality Center is the HP test management solution.

QTP

QuickTest Professional

QTP is an automated functional Graphical User Interface (GUI) testing tool created by the HP subsidiary Mercury Interactive that allows the automation of user actions on a web or client based and desktop computer application. It is primarily used for functional regression test automation. QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test.

As part of a functional test suite, it works together with Mercury Interactive WinRunner and HP Quality Center and supports enterprise Quality Assurance.

Overview

QTP is UI automation software designed for testing Web-based and Windows based applications running on Microsoft Windows. Like other test automation tools, it works by identifying the objects in the application UI or a web page and performing the desired operations on them (like mouse clicks or keyboard events); it can also be used to capture object properties like name or handler ID etc. To perform these actions, QTP uses a scripting language built on top of VBScript to specify the test procedure, and to manipulate the objects and controls of the application under test. To perform sophisticated actions, users may need to manipulate the underlying VBScript.

Though QTP is usually used for "UI Based" Test Case Automation, it can automate some "Non-UI" based Test Cases. (e.g. API (Certification testing), Database Testing, etc.)


Different Releases or Versions are as follows:-
1)10.0 - Released in 2009
2)9.5
3)9.2 - Released in 2007
4)9.0 - Released in 2006
5)8.2 - Released in 2005


License models

QTP comes with a 14-day demo license, and supports a node-locked seat license, as well as floating or concurrent licenses.

To execute, users select the playback button, which re-executes the commands against the application under test. In real world usage, simply recording and playing-back actions is generally not valuable, as it simply repeats a test already executed and may no longer be valid (because the record now exists in the system, for example).

User interface
QuickTest provides two main views of a script: Keyword View and Expert View. They are selected from tabs at the bottom of the QuickTest Professional window.


Keyword view
Keyword View is QTP's default test procedure interface. It displays the automation steps of a test procedure as a descriptive tree of actions and functions. The tree contains columns listing the action or function name, parameters, and comments. This mode is useful for the beginners. This view allows the user to select the objects either from the application or from the Object Repository and the user can select the methods to be performed on those objects. The script is automatically generated. Users can also set checkpoints from the keyword view. Users without technical knowledge may be able to understand the Keyword View, but more experienced users and users needing to perform more complicated actions may need to switch to Expert View.

Expert viewIn Expert View, QTP allows display and editing of the test's source code using VBScript. All test actions can be edited here except for the root Global action. Expert View acts as an IDE for the test. It includes many standard IDE features, such as breakpoints and also the codes.

LanguagesQTP uses VBScript as its scripting language. VBScript supports classes but not polymorphism and inheritance. Compared with Visual Basic for Applications (VBA), VBScript lacks the ability to use some Visual Basic keywords, does not come with an integrated debugger, lacks an event handler, and does not have a forms editor. HP has added some of these features to QTP, such as a debugger, but QTP's functionality is more limited in these areas compared with testing tools that integrate a full-featured IDE, such as those provided with VBA, Java, or VB.NET.

QTP is widely/most popularly used Functional/Regression Test automation tool. It was developed by Mercury Interactive and acquired by HP.

But anyway, we need to do proper tool evaluation before selecting QTP for automating testing of our application.

Since QTP can support external add-ins, it can be used for many different applications.

Some add-ins (e.g ActiveX, VisualBasic,Web) are built-in with QTP, and some other add-ins (e.g Java, .net, TE (termial emulator))are external add-ins.

We can load only the required add-ins when opening the QTP IDE. So it will be helpful to improve the execution speed.

QTP will support Keyword Driven and Data Driven testing. We can create our own test automation framework also based on our own requirements for test automation.

It is very important to understand how QTP works. Because it will help to learn any other feature in QTP easily. And also it will help to design an effective automation framework and also it help to resolve any issue faced during automation script development and also during script execution.

All we know that every test case should have Test Steps and Expected Results.

As QTP is used for executing these test cases, QTP also should have way for handling both Test Steps and Expected Results.

Handling Test Steps means QTP should be capable of navigating any path/page in any website or in any software application.
So, for doing this QTP should be able to recognize any control/object in any application/webpage. For recognizing the object, it should know the properties of those objects beforehand. It is achieved by storing the properties of the objects in a centralized place known as Object Repository.

While running the test script, the objects in the application are identified/recognized by comparing the properties of them with the properties stored in the Object Repository. By doing this execution of Test Steps becomes possible.

QTP is having Datatables (similar to Excel sheet) for supporting execution for multiple iterations of same steps with different data. For example, assume that we need to execute two test cases, one for logging into a website using UPPER case username and another test case for logging into a website using lower case username.

For executing these two test cases, the steps will be same. The only difference is in the test data.

It can be easily done in QTP by putting these input usernames in Datatable and make the Script to execute it two times.

Next, we need to think about handling Expected Results. The purpose of testing is comparing the Actual result with the predefined Expected Results. It is achieved by using Checkpoints.

There are many checkpoints available in QTP. They are, Standard Checkpoint,Text Checkpoint, Bitmap Checkpoint, Database Checkpoint, accessibility Checkpoint and XML Checkpoint.

Actually QTP can be used simply as Record and Play type tool for automation of simple steps on simple applications. But it should be extensively used by writing user defined functions and many other features to get more benefit from it.

QTP is not using any Proprietary Script. It uses commonly available VBscript. So writing script will be simple. And also, vbscript is commonly used in many places such as Web development (ASP), and in windows administration works. So we can easily find lot of already available user-defined functions and help articles in the Internet.

And also, QTP supports COM model. i-e Any methods and properties of any COM based application can be easily accessed from QTP. For example IE(Internet Explorer) and Excel Objects can be created within QTP script. It is applicable for QTP itself.
i-e Object of QTP itself can be created and handled. It is known as Automation Object Model.

Basically QTP is a functional/Regression testing tool. But it can be indirectly used for testing performance also. (i-e QTP scripts can be be called from performance testing tool "Load Runner"). And also, QTP is having limited performance testing options such as start and end transactions which will be helpful to find execution time for particular block of steps.

QTP can be closely integrated with the Test Management Tool Quality Center (QC). QC can be effectively used to run QTP scripts in multiple remote machines to complete execution of many test scripts in less time.

The user friendly IDE which has Keyword view, Expert view, Datatable, Active screen, object repository editor/manager,step generator, function generator,object highlight feature, intellisense, recovery scenario manager, update run feature and simple Test/Action handling features makes the Script developer/execution work easy. The IDE is integrated with useful tools such as ObjectSpy. The IDE has standard development features such as Debug.

Test Automation

What is Test Automation ?

Test automation is the use of software to control the execution of tests, the comparison of actual outcomes to predicted outcomes, the setting up of test preconditions, and other test control and test reporting functions. Commonly, test automation involves automating a manual process already in place that uses a formalized testing process

Overview

Although manual tests may find many defects in a software application, it is a laborious and time consuming process. In addition it may not be effective in finding certain classes of defects. Test automation is a process of writing a computer program to do testing that would otherwise need to be done manually. Once tests have been automated, they can be run quickly. This is often the most cost effective method for software products that have a long maintenance life, because even minor patches over the lifetime of the application can cause features to break which were working at an earlier point in time.

There are two general approaches to test automation:

1) Code-driven testing:- The public (usually) interfaces to classes, modules, or libraries are tested with a variety of input arguments to validate that the results that are returned are correct.

2) Graphical user interface testing:- A testing framework generates user interface events such as keystrokes and mouse clicks, and observes the changes that result in the user interface, to validate that the observable behavior of the program is correct.

Test automation tools can be expensive, and it is usually employed in combination with manual testing. It can be made cost-effective in the longer term, especially when used repeatedly in regression testing.

One way to generate test cases automatically is model-based testing through use of a model of the system for test case generation, but research continues into a variety of alternative methodologies for doing so.[citation needed]

What to automate, when to automate, or even whether one really needs automation are crucial decisions which the testing (or development) team must make. Selecting the correct features of the product for automation largely determines the success of the automation. Automating unstable features or features that are undergoing changes should be avoided

What to test

Testing tools can help automate tasks such as product installation, test data creation, GUI interaction, problem detection (consider parsing or polling agents equipped with oracles), defect logging, etc., without necessarily automating tests in an end-to-end fashion.

One must keep following popular requirements when thinking of test automation:

a)Platform and OS independence
b)Data driven capability (Input Data, Output Data, Meta Data)
c)Customizable Reporting (DB Access, crystal reports)
d)Easy debugging and logging
e)Version control friendly – minimum or zero binary files
f)Extensible & Customizable (Open APIs to be able to integrate with other tools)
g)Common Driver (For example, in the Java development ecosystem, that means Ant or Maven and the popular IDEs). This enables tests to integrate with the developers' workflows.
h)Supports unattended test runs for integration with build processes and batch runs. i)Continuous Integration servers require this.
j)Email Notifications (Automated notification on failure or threshold levels). These may be the test runner or tooling that executes it.
k)Support distributed execution environment (distributed test bed)
l) Distributed application support (distributed SUT)

Software Test Automation is the process of automating the steps of manual test cases using an automation tool Or utility to shorten the testing life cycle with respect to time…

When application undergoes regression, some of the steps might be missed out or skipped which can be avoided in Automation…
Automation helps to avoid human errors and also expedite the testing process…
To implement the Test Automation detailed planning and effort is required
Automation saves time and effort which results in reduction of the Test life cycle…

Benefits of Automation

- Consistency of Test Execution
- Reducing cycle time of regression test cycles
- Data driven testing
- Repeatability
- Coverage
- Reliability
- Reusability of test wares

Automation life cycle is a subset of the entire test life cycle…
Automation planning can be initiated in parallel to the test planning phase…
Factors to be considered in automation planning,
Stability of AUT (Application under test)
No of regression cycles to be performed
Compatibility of App platform with testing tools
Cost benefit analysis (ROI)
Availability of skilled resources

When Automation is applicable?

1) Regression Testing Cycles are long and iterative.
2) If the application is planned to have multiple releases / builds
3) If it’s a long running application where in small enhancements / Bug Fixes keeps happening
4) Test Repeatability is required

Wednesday, February 3, 2010

Automated Test Script Creation Process

Debugging and troubleshooting test scripts becomes extremely tedious when the test script has hundreds of lines of code, verification points, branching logic, error handling, parameters, and test correlation among various recorded business processes. A more manageable approach to debugging complex and lengthy test scripts is to record portions of the script and debug those portions individually before recording other parts of the test script. After testing individual portions, you can determine how one portion of the test script works with another portion and how data flows from one recorded process to the other. After all sections for a test script have been recorded, you can playback the entire test script and ensure that it properly plays back from the beginning to the end with one or more sets of data.

Always create a test plan that will assist in the creation of the regression test script. A test script is only as good as the planning that takes place before it is written. This saves time and organizes the process.

Remember that all regression test scripts will be written to run in the QA environment as well as the production environment. The automated regression test use will be a part of the production test used to determine if a build truly does function as expected in production.

To manage the creation and edit of our automated regression tests QA will create automated tests in the following manner:

1.Record each individual process such as logging in and logging out. Save those recordings on your desktop.

2.Verify that the script will play back with no errors.

3.Continue recording and playing back throughout the test script creation process, verifying the script will play back with each step taken.

4.Add multiple sets of data driven tests for each individual portion of each test where that kind of test is applicable.

5.Verify the individual test scripts with multiple sets of data will play back with no errors.

6.Add various check points throughout the test.

7.Verify the individual test scripts with various check points will play back with no errors.

8.Now integrate all recorded processes into one large test script.

9.Verify the large test script will play back with no errors.

The key here is to ensure that each recorded process plays back successfully before proceeding to record the remaining portions of the entire test script. Do not string the individual tests together for playback without first verifying that all of the processes could play back successfully as individual processes.

Lesson to be learned here is to never, EVER wait to debug a script until the entire test script has been recorded.

Synchronization

Since QTP can play back recorded test scripts much faster than an end-user’s manual keystrokes all tests must be synchronized. Introduce artificial wait times in the test scripts to make sure the script will run appropriately without errors unattended. Take into account the fact that there will be times when the script will need to run slower than a manual test due to network issues, etc. The goal here is we want to make sure the scripts will run unattended through Test Director. Slowing down a script with wait times is not very scientific and does not contribute to the creation of a robust automated test script that plays back successfully without user intervention. That said, sync times will be edited after the test script has been written in its entirety and has been tested to ensure it runs with no errors.

Signed-off, Peer Reviewed

As part of the test readiness review criteria, test scripts will be formally accepted and approved prior to starting the test cycle. QA, Business Analysts and Developers should be involved in approving recorded test scripts. The QA Analyst writing the automated test script should demonstrate that the test script successfully plays back in the QA environment and, if possible, with various sets of data.

Recording, Playing Back Against Hidden Objects

Scripts might be recorded to populate or double click values for a field within a table grid or an array where the location of this field is not fixed. If the field’s location within a table grid or array changes from the time it was recorded, the script might fail during play back. Test scripts often fail during play back because the locations of objects that are not displayed or visible within the screen have changed.

In order to play back scripts that are location sensitive or where the location is subject to change, it might be necessary to enhance the script with functionality such as ‘scroll down’, ‘next page’, or ‘find’. Including such utilities ensures that hidden objects requiring play back will be identified, and/or double clicked regardless of their location within an array, table grid, or the displayed screen.

Create Automatic Notification for Critical Scripts

Test scripts should be enhanced with error handling programming logic that instantly sends error messages to a tester’s e-mail address when problems occur. Since some test scripts are business critical and must run as batch jobs in the middle of the night we need to know if something failed as soon as possible. The proper and successful execution of these business critical test scripts can serve as a dependency or pre-condition for other automated tasks. Always include logic in business critical test scripts that automatically sends notification in the event of a failure.

Documentation

To make test scripts reusable and easier to maintain, please document all relevant information for executing the test script, a test script header, and any special conditions for execution of the test script. Example:

1.Adjust dates within the application in QA environment for running reports.

2.Update any fields that require unique data.

3.Display settings for context sensitive/analog/bitmap recording.

4.List other test scripts that are dependencies.

5.Specify necessary authorization levels or user roles for executing the script.

6.Conditions under which the script can fail and work around for re-launching the script.

7.Applications that need to be either opened or closed during the script execution.

8.Specific data formats, etc.

Scripts should contain a header with a description (example: what it is used for) and its particular purpose (example: regression testing). The script header should also include the script author and owner, creation and modification date, requirement identifiers that the script traces back to, the product the script supports and the number of variables and parameters of the script. Providing this information in the test script header facilitates the execution, modification, and maintenance of the script for future testing efforts.


Source: Mercury Forum’s KB articles

Tuesday, February 2, 2010

QTP Test Series 1

Powered by website analytics technology.

1) 'Browser navigation timeout' is in which tab of Test Settings
(File->Settings) window.

A) Properties
B) Resources
C) Web
D) Web Settings

2) How many tabs are there in Test Settings (File->Settings) window

A) 7
B) 6
C) 5
D) 8

3) Identify the tabs in the Test Settings (File->Settings) window

A) Properties, Run, Resources, Parameters, Environment, Web, Recovery
B) Properties, Run, Resources, Parameters, Environment, Web
Settings,Recovery
C) Properties, Run Options, Resources, Parameters, Environment, Web,
Recovery
D) Properties, Run, Resources, Input Parameters, Environment, Web, Recovery

4) 'Generate Script' is in which tab of Test Settings (File->Settings)
window

A) Properties
B) Web
C) Resources
D) Recovery

5) The following are the four main columns in the Keyword view

A) Item, Operation, Value, Comments
B) Item, Operation, Value, Documentation
C) Item, Operation, Property, Documentation
D) Number, Operation, Value, Documentation

6) For each object and method in an Expert View statement, a
corresponding row exists in the Keyword View.

A) True
B) False
C) There is a problem with the statement.
D) None of above

7) You can work on one or several function libraries at the same time.

A) True
B) False

8) You can insert additional steps on the test objects captured in the
Active screen after the recording session.

A) True
B) False

9) The Active Screen enables you to parameterize object values and
insert checkpoints

A) True
B) False

10) A QTP user can increase or decrease the active screen information
saved with the test.

A) True
B) False

Answers
1) C, 2) A, 3) A, 4) A, 5) b, 6) A, 7) A, 8) A, 9) A, 10) A

QTP Test Series 2

11) The Information pane provides a list of............. in the test:

A) Semantic errors
B) Syntax errors
C) Common errors
D) Logic errors

12) When we switch from Expert view to the Keyword view, QTP
automatically checks for syntax errors in the test and shows them in the
information pane.

A) True
B) False

13) If the information pane is not open, QTP automatically opens it in
case a syntax error is detected.

A) True
B) False

14) ..................... provides a list of the resources that are
specified in your test but cannot be found.

A) Missing pane
B) Missing Resources pane
C) Resources pane
D) Missing Items pane

15) Whenever you open a test or a function library, QTP automatically
checks for the availability of specified resources.

A) True
B) False

16) The Data Table does not assists you in parameterizing your test.

A) True
B) False

17) Tabs in the Debug Viewer pane are:

A) Watch, Variables, Debug
B) Watch, Data, Command
C) Watch, Variables, Command
D) View, Variables, Command

18) ............... tab enables you to view the current value of any
variable or VBScript expression.

A) Watch
B) VIew
C) Locate
D) Current

19) The .... tab displays the current value of all variables that have
been recognized up to the last step performed in the run session.

A) View
B)Variables
C) Locate
D) Current

20) The .........tab enables you to run a line of script to set or
modify the current value of a variable or VBScript object in your test
or function library.

A) View
B) Variables
C) Command
D) Current

Answers

11) B, 12) A, 13) A, 14) B, 15) A, 16) B, 17) C, 18) A, 19) B, 20) C

QTP Test Series 3

21) Panes in QTP can have one of the following states—docked or floating.

A) True
B) False

22) Which of the following statement is True:

A) QuickTest enables you to open and work on one test at a time
B) QuickTest enables you to open and work on two tests at a time
C) QuickTest enables you to open and work on predefined number of tests
at a time
D) QuickTest enables you to open and work on nine test at a time

23) Which of the following statement is True:

A) You can open and work on two function libraries simultaneously
B) You can open and work on multiple function libraries simultaneously
C) You can open and work on nine function libraries simultaneously
D) You can open and work on one function library at a time

24) You can open any function library, regardless of whether it is
associated with the currently open test.

A) True
B) False

25) You can work with multiple documents (test, component, or
application area, function libraries) using the...... dialog box

A) Panes
B) Display
C) Show
D) Windows

26) QuickTest has ..... built-in toolbars.

A) 5
B) 6
C) 7
D) 8

27) The ......... toolbar contains buttons for recording and running
your test.

A) Standard
B) Tools
C) Automation
D) Edit

28) Shortcut Key for opening a new Function Library is:

A) Shift+Alt+N
B) Ctrl+Alt+N
C) Shift+N
D) CRTL+N

29) Shortcut Key for Closing all open Function Libraries in one go.

A) Ctrl+Alt+C
B) Shift+A+C
B)Shift+N
D) None of these

30) shortcut Key for Commenting out the current row, or selected rows

A) Shift+M
B) Ctrl+C
C) Ctrl+M
D) Shift+C


Answers

21) A, 22) A, 23) B, 24) A, 25) D, 26) D, 27) C, 28) A, 29) D, 30) C

QTP Test Series 4

31) You can manage the test actions and the test or function library
steps using the ... menu commands

A) File
B) Edit
C) Automation
D) Tools

32) To expand all the steps in the keyword view which option you would
use from the View menu.

A) Expand
B) Expand All
C) Expand Items
D) Expand Rows

33) What is the shortcut key to open a Step Generator.

A) F2
B) F5
C) F6
D) F7

34) Function Definition Generator in found in which menu option.

A) File
B) Tools
C) Insert
D) View

35) The shortcut keys for Record, Stop and Run respectively are

A) F3, F4, F5
B) F4, F3, F5
C) F4, F5, F3
D) F3, F5, F4

36) What is the shortcut key for opening an Object Repository.

A) Alt+R
B) Shift+R
C) Ctrl+R
D) Shift+O+R

37) Shortcut key to Insert/Remove a breakpoint is

A) F9
B) F8
C) Ctrl+b
D) Shift+b

38) .........runs only the current line of the script. If the current
line calls a method, the method is displayed in the view but is not
performed.

A) Step Over
B) Step Out
C) Step Into
D) Step Till

39) .........runs only the current line of the script. When the current
line calls a method, the method is performed in its entirety, but is not
displayed in the view.

A) Step Over
B) Step Out
C) Step Into
D) Step Till

40) What is the shortcut key to Clear all Breakpoints

A) Ctrl+Shift+F9
B) Shift+Ctrl+F9
C) Alt+Shift+F9
D) Alt+Ctrl+F9


Answers

31) B, 32) B, 33) D, 34) C, 35) A, 36) C, 37) A, 38) C, 39) A, 40) A

QTP Test Series 5

41) Object Spy can be found in ........menu.

A) Tool
B) Tools
C) Task
D) Tasks

42) ............ displays the open documents side-by-side.

A) Tile Vertically
B) Tile Horizontally
C) Cascade
D) Tile Cascade

43) For opening the QuickTest Professional Help we can use.......

A) F3
B) F5
C) F1
D) F2

44) If QTP cannot find any object that matches the description, or if it
finds more than one object that matches, QuickTest may use
the............mechanism to identify the object.

A) Ordinal Identifier
B) Index Identifier
C) Smart Identification
D) Assistive Identification

45) You can configure the ........, ............ and ............
properties that QuickTest uses to record descriptions of the objects in
your application

A) mandatory, assistive, and ordinal identifier
B) mandatory, required, and ordinal identifier
C) smart, assistive, and ordinal identifier
D) Index, assistive, and ordinal identifier

46) The .......... property set for each test object is created and
maintained by QuickTest.

A) Run-Time Object
B) Test Object
C) Smart Identification Object
D) Assistive Object

47)You can access and perform ......... methods using the Object property.

A) Run-Time Object
B) Test Object
C) Smart Identification Object
D) Assistive Object

48) You can view or modify the test object property values that are
stored with your test in the .........

A) Information Pane
B) Data Table
C) Information Pane & Data Table Both
D) Object Properties & Object Repository dialog box.

49) You can retrieve or modify property values of the test object during
the run session by adding ..........statements in the Keyword View or
Expert View.

A) GetROProperty & SetROProperty
B) GetTOProperty & SetTOProperty
C) GetTOProperty & SetROProperty
D) GetROProperty & SetTOProperty

50) If the available test object methods or properties for an object do
not provide the functionality you need, you can access ..............of
any run-time object using the Object property.

A) The internal methods and properties
B) The mandatory methods and properties
C) The selective methods and properties
D) The assistive methods and properties


Answers

41) B, 42) A, 43) C, 44) C, 45) A, 46) B, 47) A, 48) D, 49) B, 50) A

QTP Test Series 6

51) Using the Object Spy, you can view

A) the run-time or test object properties and methods of any object in
an open application.
B) the run-time or test object properties of any object in an open
application.
C) the test object properties and methods of any object in an open
application.
D) the run-time object properties and methods of any object in an open
application.

52) There are .........object type filters in Object spy dialog box.

A) Two
B)Three
C) Four
D) Five

53) In the Object Spy window, in the Properties Tab

A) Copying of Properties and its values is possible with CTRL+C
B) Copying of Properties and its values is possible by right clicking on
it and choosing copy.
C) Copying of Properties and its values is possible with both A) and B)
methods
D) Copying of Properties and its values is possible is not possible

54) In the Object Spy window, in the methods Tab

A) Copying of Methods is possible with CTRL+C
B) Copying of Methods is possible by right clicking on it and choosing copy.
C) Copying of Methods is possible with both A) and B) methods
D) Copying of Methods is possible is not possible

55) Object Spy dialog box

A) Can be resized
B) Cannot be resized

56) .............. are the highest level of the test hierarchy in the
Keyword view.

A) Tests
B) Steps
C) Call to Actions
D) Actions

57) You can copy and paste or drag and drop actions to move them to a
different location within a test

A) True
B) False

58) You can print the contents of the Keyword View to your Windows
default printer (and even preview the contents prior to printing).

A) True
B) False

59) In the Keyword View, you can also view properties for items such as
checkpoints.

A) True
B) False

60) In the step Browser > Page > Edit > Set "Sachin", identify container
object(s)

A) Browser
B) Edit
C) Page
D) Both Browser & Page

Answers
51) A, 52) A, 53) A, 54) A, 55) A, 56) D, 57) A, 58) A, 59) A, 60) D

QTP Test Series 7

61) 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 anypoint

62) The Documentation cell is .............

A) Read-only
B) Write-only
C) Read and Write
D) Read, write & execute

63) 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

64) 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

65) 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

66) The Value cell in the keyword view can contain........ value

A) Constant
B) Parameter
C) Both A) & B)
D) None of these

67)The ............... enables you to encode your passwords and place
secure values into the Data Table.

A) Password Encoder
B) Password Decoder
C) Password Encode
D) Password Decode

68) You can also encrypt strings in Data Table cells using the .........
option in the Data Table menu.

A) Decrypt
B) Encrypt
C) Encrypt Code
D) Decrypt Code

69) In addition to adding standard statement steps to your test using
the Keyword View, you can also insert

A) Checkpoint step
B) Output value step
C) Comment step
D) All of above

70) The correct syntax of the conditiona statement starting with Do is.....

A) Do...While
B) Do...Until
C) Do...Next
D) Both A) and B)


Answers

61) D, 62) A, 63) D, 64) C, 65) A, 66) C, 67) A, 68) B, 69) D, 70) D

QTP Test Series 8

71) QuickTest processes a comments when it runs a test.

A) True
B) False

72) Press ..... to add a new step below the currently selected step.

A) F8
B) Shift + A
C) F0
D) Shift + A + Q

73) While working with the Keyword View, you can ...... steps to move
them to a different location in a test or in an action

A) Copy and Paste
B) Cut and Paste
C) Drag and drop
D) Both A) and C)

74) You can specify the order in which the columns are displayed in the
Keyword view.

A) True
B) False

75) 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


76) You cannot manage some aspects of a local object repository using
the QuickTest Object Repository automation object model..

A) True
B) False

77) For each action, you can use a combination of objects from your
local and shared object repositories.

A) True
B) False

78) 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

79) 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

80) The ....... is not accessible as a separate file

A) local object repository
B) shared object repository
C) Both
D) None

Answers

71) B, 72) A, 73) D, 74) A, 75) G, 76) B, 77) A, 78) A, 79) B, 80) A

QTP Test Series 9

81) In the Object Repository window:.
A) Local objects are editable (black)
B) Shared objects are in read-only format (gray)
C) Local objects are in read-only format (gray)
D) Shared objects are editable (black)

82) Mark true statement(s):.
A) You can delete objects from a shared object repository using the Object Repository window.
B) You can delete objects from the local object repository using the Object Repository Manager
C) You can delete objects from the local object repository using the Object Repository window
D) You can delete objects from a shared object repository using the Object Repository Manager

83) You can modify an object stored in a shared object repository.
A) using the Object Repository Manager
B) using the Object Repository window
C) you can copy it to the local object repository and then modify its properties
D) you cannot modify properties of objects stored in Shared object repository

84) If an object is contained in both local and shared repositories then, during a run session.
A) QuickTest will use the object in the local object repository
B) QuickTest will use the object in the Shared object repository
C) There will be a conflict
D) QuickTest will use Descriptive Programming

85) When you copy an object to the local object repository
A) its parent objects are also copied to the local object repository
B) its parent objects are not copied to the local object repository
C) You have to manually copy its parent objects are also copied to the local object repository
D) You have to manually drag and drop its parent objects

86) For tests, you can also view test object properties and property values for objects in the Active Screen, regardless of whether the objects arestored in the object repository.
A) True
B) False

87) Object Properties window differs for objects stored in Shared and Local object repository.
A) True
B) False

88) You can rename objects in the shared object repository using the Object Repository Manager
A) True
B) False, you cannot rename objects in shared object repository

89) When you modify the name of an object in the local object repository, the name is automatically updated in ....... for all occurrences of the object..
A) in the Keyword View
B) in the Expert View
C) Both Keyword and Expert View
D) Changing name of an object doest not effect keyword or expert view

90) When you modify the name of an object in a shared repository, the name is automatically updated in all tests open on the same computer that use the object repository as soon as you make the change, even if you have not yet saved the object repository with your changes.
A) True
B) False

Answers
81) A,B, 82) C,D, 83) A,C, 84) A, 85) A, 86) A, 87) A, 88) A, 89) C, 90) A

HP QTP Certification Practice Exam 1

Q1. How many tabs are there in Test Settings (File->Settings) window
A) 5
B) 6
C) 7
D) 8
Q2. 'Browser navigation timeout' is in which tab of Test Settings (File->Settings) window?
A) Properties
B) Resources
C) Web
D) Web Settings
Q3. Identify the tabs in the Test Settings (File->Settings) window
A) Properties, Run, Resources, Parameters, Environment, Web, Recovery
B) Properties, Run, Resources, Parameters, Environment, Web Settings,Recovery
C) Properties, Run Options, Resources, Parameters, Environment, Web, Recovery
D) Properties, Run, Resources, Input Parameters, Environment, Web, Recovery
Q4. 'Generate Script' is in which tab of Test Settings (File->Settings) window
A) Properties
B) Resources
C) Web
D) Recovery
Q5. For each object and method in an Expert View statement, a corresponding row exists in the Keyword View.
A) True
B) False
C) There is some problem with the statement.
D) None of above
Q6. The following are the four main columns in the Keyword view
A) Item, Operation, Value, Comments
B) Item, Operation, Value, Documentation
C) Item, Operation, Property, Documentation
D) Number, Operation, Value, Documentation
Q7. You can work on one or several function libraries at the same time.
A) True
B) False
Q8. You can insert additional steps on the test objects captured in the Active screen after the recording session.
A) True
B) False
Q9. The Active Screen enables you to parameterize object values and insert checkpoints
A) True
B) False
Q10. A QTP user can increase or decrease the active screen information saved with the test.
A) True
B) False
Q11. The toolbar enables you to view the details of an individual action or the entire test flow is:
A. Testing toolbar
B. None of the above
C. Action toolbar
D. Test Pane
Q12. The key that is used to Start/End analog recording mode ?
A. F3
B. SHIFT+ALT+F3
C. CTRL+SHIFT+F3
D. F10
Q13. QuickTest supports virtual object for analog or low-level recording.
A. False
B. True
Q14. To use a specific property to identify your object, but that property is not listed in the properties list. Then how do you identify that object?
A. Add the specific property to the list
B. Use the Default property
C. Use some other property to identify your object
Q15. The checkpoint used to check the alt attribute exists for all relevant objects (such as images) is
A. Database CheckPoint
B. Accessibility checkpoint
C. Bitmap checkpoint
D. Standard checkpoint
Q16. Bitmap checkpoint is supported in VB environment.
A. True
B. False
Q17. Can we parameterize the checkpoints properties?
A. NoB. Yes
Q18. What is the shortcut key that is used for a Standard Checkpoint?
A. F12
B. F2
C. F10
D. F7
Q19. Can we change name of checkpoint?
A. No
B. Yes
Q20. To compare the values of the specified property during a run session with the values stored for the same test object property within the test.
A. Checkpoint
B. All the above
C. Output Value
D. Compare the object property
Q21. You will use which recording mode for an object not recognized by QuickTest?
A. Low-Level Recording Mode
B. Normal recording Mode
C. Analog Mode
Q22. The statement that calls the recorded analog file is:
A. RunAnalog
B. CallAnalog
C. ExecuteAnalog
Q23. An action can be called by other tests or actions is:
A. Call Action
B. Split Action
C. Reusable Action
Q24. You can replace the page in your Active Screen tab:
A. False
B. True
Q25. QuickTest adds a checkpoint statement in the Expert View as:
A. Check Checkpoint
B. Checkpoint
Q26. A Checkpoint checks that a text string is displayed within a defined area in a Windows application is:
A. Accessibility
B. Text Area
C. Standard
D. Text
Q27. In ACTIVE X environment, an ACCESSIBILITY checkpoint is supported?
A. No
B. Yes
Q28. Can we get the execution time for an action in a Test?
A. Yes
B. No
Q29. Can we add external library files in QTP?
1. No
2. Yes
Q30. The method used to get data from HTML Table is
A. GetData(Row,Col)
B. GetRowValue(Rowid,Colname)
C. GetCellData (Row,Col)

HP QTP Certification Practice Exam 2

Q1. The Command used to insert the transactions in test is:

A. StartTransaction(Name�), EndTransaction(Name�)

B. Services.StartTransaction "Name", Services.EndTransaction "Name"

C. StartTransaction.services "Name�, EndTransaction.services "Name"

Q2. A step in which one or more values are captured at a specific point in your test and stored for the duration of the run session is:

A. Output Value

B. Checkpoints

C. Active Screen

Q3. QTP can detects an application crash and activate a defined recovery scenario to continue the run session.

A. True

B. false

Q4. In Batch Test process, the test list are saved in file format as:

A. *.mtb

B. *.mts

C. *.mbt

D. *.mtr

Q5. The command used to invoke other application from QTP:

A. InvokeApplication

B. SystemUtil.Run

C. Run

D. Both b & c

E. Both a & b

Q6. The command used to retrieve data from excel sheet is

A. Set ab = Connection("srcfilepath ") , Set ws = ab.getdata(sheetid)

B. Set ab = CreateObject("srcfilepath ") , Set ws = ab.getsheet(sheetid)

C. Set ab = GetObject("srcfilepath") , Set ws = ab.worksheets(sheetid)

Q7. The method that explicitly activates the recovery scenario mechanism is:

A. recovery.activate

B. enable

C. recovery.enable

D. activate

Q8. The method used for sending information to the test results is:

A. Reporter.log()

B. Reporter.reportevent()

C. Reporter.msgbox()

D. Reporter.report()

Q9. To terminate an application that is not responding we use:

A. SystemUtil.terminate

B. SystemUtil.Stop

C. SystemUtil.CloseProcessByName

Q10. The recovery mechanism does not handle triggers that occur in the last step of a test:

A. false

B. True

Q11. We can add Test object methods, function calls into the Test using:

A. Function generator

B. Step generator

C. Object repository

Q12. The method that adds to the test while implementing synchronization is:

A. Synchronize

B. Wait

C. WaitProperty

D. Pause

Q13. The mechanism used to identify objects during run session is:

A. Recovery scenario

B. Smart identification

C. Handling object

Q14. Post-recovery test run options specifies:

A. how to continue the run session after QTP identify the event

B. errors while running

C. recovery scenario during a run session

Q15. The action that can be called multiple times by the test as well as by other tests is called:

A. non-reusable action

B. Reusable action

C. External action

Q16. The command used to connect with Database is:

A. Createobject(connectivity name�)

B. dbconnect(connectivity name)

C. open(connectivity name)

D. None of the above

Q17. The method used to retrieve the folders is:

A. FileSystemObject.Getfolder()

B. FileSystemObject.selectfolder()

C. FileSystemObject.retrievefolder()

Q18. The method used to compare 2 XML files is:

A1. XMLfile1.compare(XMLfile2)

B. XMLcompare(file1,file2)

C. compare(XMLfile1,XMLfile2)

Q19. The QTP script files are stored in the extension of:

A. *.mts

B. *.usr

C. *.mtr

D. *.vbs

Q20. The method used to register the user-defined function with test object is:

A. setFunc()

B. RegisterUserFunc()

C. RegisterFunc()

Q21. The method used to open the specified URL in a browser is:

A. openURL()

B. navigateURL()

C. navigate()

Q22. The 3 Parameter types available in data driver is:

A. DataTable,Environment,Random number

B. DataTable,random number,unique

C. environment,string,numeric

Q23. The method added to the test while parameterizing is:

A. get Data (variable, dtGlobalSheet)

B. get DataTable(variable, dtGlobalSheet)

C. Set Data(variable, dtGlobalSheet)

D. Set DataTable(variable, dtGlobalSheet)

Q24. The length of the array can be get by the method:

A. length(array)

B. ubound(array)

C. count(array)

Q25. The method used to get the count value of list box or combo box is:

A. GetItemsCount

B. GetCount

C. GetItemCount

Q26. To retrieve the current the objects in your application during the run session:

A. GetVisibleText

B. GetROProperty

C. SetROProperty

D. GetTOProperty

Q27. The list of test objects and their properties and values are stored in the:

A. Object Repository

B. Object Identification

Q28. The method used to continue the test execution after getting run-time error is:

1. On Error Resume Next

2. On Error Raise Next

3. On Error Next

HP QTP Certification Practice Exam 3

Q1. 'Browser navigation timeout' is in which tab of Test Settings (File->Settings) window.

A) Properties

B) Resources

C) Web

D) Web Settings

Q2. How many tabs are there in Test Settings (File->Settings) window

A) 7

B) 6

C) 5

D) 8

Q3. Identify the tabs in the Test Settings (File->Settings) window

A) Properties, Run, Resources, Parameters, Environment, Web, Recovery

B) Properties, Run, Resources, Parameters, Environment, WebSettings,Recovery

C) Properties, Run Options, Resources, Parameters, Environment, Web,Recovery

D) Properties, Run, Resources, Input Parameters, Environment, Web, Recovery

Q4. 'Generate Script' is in which tab of Test Settings (File->Settings)window

A) Properties

B) Web

C) Resources

D) Recovery

Q5. The following are the four main columns in the Keyword view

A) Item, Operation, Value, Comments

B) Item, Operation, Value, Documentation

C) Item, Operation, Property, Documentation

D) Number, Operation, Value, Documentation

Q6. For each object and method in an Expert View statement, acorresponding row exists in the Keyword View.

A) True

B) False

C) There is a problem with the statement.

D) None of above

Q7. You can work on one or several function libraries at the same time.

A) True

B) False

Q8. You can insert additional steps on the test objects captured in the Active screen after the recording session.

A) True

B) False

Q9. The Active Screen enables you to parameterize object values andinsert checkpoints

A) True

B) False

Q10. A QTP user can increase or decrease the active screen informationsaved with the test.

A) True

B) False

Q11. The Information pane provides a list of............. in the test:

A) Semantic errors

B) Syntax errors

C) Common errors

D) Logic errors

Q12. When we switch from Expert view to the Keyword view, QTPautomatically checks for syntax errors in the test and shows them in theinformation pane.

A) True

B) False

Q13. If the information pane is not open, QTP automatically opens it incase a syntax error is detected.

A) True

B) False

Q14. ..................... provides a list of the resources that arespecified in your test but cannot be found.

A) Missing pane

B) Missing Resources pane

C) Resources pane

D) Missing Items pane

Q15. Whenever you open a test or a function library, QTP automaticallychecks for the availability of specified resources.

A) True

B) False

Q16. The Data Table does not assists you in parameterizing your test.

A) True

B) False

Q17. Tabs in the Debug Viewer pane are:

A) Watch, Variables, Debug

B) Watch, Data, Command

C) Watch, Variables, Command

D) View, Variables, Command

Q18. ............... tab enables you to view the current value of anyvariable or VBScript expression.

A) Watch

B) VIew

C) Locate

D) Current

Q19. The .... tab displays the current value of all variables that havebeen recognized up to the last step performed in the run session.

A) View

B)Variables

C) Locate

D) Current

Q20. The .........tab enables you to run a line of script to set ormodify the current value of a variable or VBScript object in your testor function library.

A) View

B) Variables

C) Command

D) Current

Q21. Panes in QTP can have one of the following states—docked or floating.A) TrueB) FalseQ22. Which of the following statement is True:

A) QuickTest enables you to open and work on one test at a time

B) QuickTest enables you to open and work on two tests at a time

C) QuickTest enables you to open and work on predefined number of testsat a time

D) QuickTest enables you to open and work on nine test at a time

Q23. Which of the following statement is True:

A) You can open and work on two function libraries simultaneously

B) You can open and work on multiple function libraries simultaneously

C) You can open and work on nine function libraries simultaneously

D) You can open and work on one function library at a time

Q24. You can open any function library, regardless of whether it isassociated with the currently open test.

A) True

B) False

Q25. You can work with multiple documents (test, component, orapplication area, function libraries) using the...... dialog box

A) Panes

B) Display

C) Show

D) WindowsAnswers:-->