Friday, July 11, 2008

Interview Questions of QTP

Q. What is QTP ?

A) Quick Test is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, Quick Test Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications…


Q. Explain QTP Testing process ?

A) The Quick Test 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, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
2. Enhancing your test
o 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.
o 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.
o Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
3. Debugging your test
If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
4. 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.
5. Analyzing the test results
You examine the test results to pinpoint defects in your application.
6. Reporting defects
As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

Q.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 Quick Test commands

File toolbar, containing buttons to assist you in managing tests, containing buttons used while creating and maintaining tests

Test toolbar

Debug toolbar, containing buttons used while debugging tests.Note: The Debug toolbar is not displayed when you open Quick Test for the first time. You can display the Debug toolbar by choosing View > Toolbars > Debug. Note that this tutorial does not describe how to debug a test. For additional information, refer to the

Quick Test Professional User’s Guide.

Action toolbar, containing buttons and a list of actions, enabling you to view the details of an individual action or the entire test flow.


Note: The Action toolbar is not displayed when you open Quick Test for the first time. You can display the Action toolbar by choosing View > Toolbars > Action. If you insert a reusable or external action in a test, the Action toolbar is displayed automatically. For additional information, refer to the Quick Test Professional User’s Guide.

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


Q. Explain about the Test Fusion Report of QTP ?
A) Once a tester has run a test, a Test Fusion report displays all aspects of the test run: a high-level results overview, an expandable Tree View of the test specifying exactly where application failures occurred, the test data used, application screen shots for every step that highlight any discrepancies, and detailed explanations of each checkpoint pass and failure. By combining Test Fusion reports with Quick Test Professional, you can share reports across an entire QA and development team.


Q. To which environments does QTP supports ?
A) Quick Test Professional supports functional testing of all enterprise environments, including Windows, Web, ..NET, Java/J2EE, SAP, Siebel, Oracle, PeopleSoft, Visual Basic, ActiveX, mainframe terminal emulators, and Web services.


Q. How the exception handling can be done using QTP
A. It can be done Using the Recovery Scenario Manager which provides a wizard that gudies you through the process of defining a recovery scenario. FYI.. The wizard could be accessed in QTP> Tools-> Recovery Scenario Manager …….


Q. How many types of Actions are there in QTP?


A. There are three kinds of actions:
non-reusable action—an action that can be called only in the test with which it is stored, and can be called only once.

reusable action—an action that can be called multiple times by the test with which it is stored (the local test) as well as by other tests.

external action—a reusable action stored with another test. External actions are read-only in the calling test, but you can choose to use a local, editable copy of the Data Table information for the external action.

Q. 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.

Q. 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 QuickTest 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:

QuickTest identifies the object that you clicked as a WebButton test object.
It creates a WebButton object with the name Find, and records the following
properties and values for the Find WebButton:
It also records that you performed a Click method on the WebButton.
QuickTest displays your step in the Keyword View like this:
QuickTest displays your step in the Expert View like this:
Browser(”Mercury Interactive”).Page(”Mercury Interactive”).WebButton(”Find”).Click

Q. 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.


Q. Syntax for how to call one script from another? and Syntax to call one “Action” in another?

A. RunAction ActionName, [IterationMode , IterationRange , Parameters] Here the actions becomes reusable on making this call to any Action. IterationRange String Not always required. Indicates the rows for which action iterations will be performed. Valid only when the IterationMode is 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.



Q. 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 are loaded).

Note: The results of bitmap checkpoints may be affected by factors such as

operating system, screen resolution, and color settings.


Q. 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.


Q. How do u do batch testing in WR & is it possible to do in QTP, if so explain?

A.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.

How to capture a tool tip text in QTP?

A.For example, how to get tool tip ('Go to My Yahoo!') from the yahoo page:

Actually, this is not a difficult task. The steps are:

1. Place mouse cursor over the link
2. Wait for tool tip
3. Get text of shown tool tip


This QTP script captures a text of a tool tip:
' Place mouse cursor over the link
Browser("Yahoo!").Page("Yahoo!").WebElement("text:=My Yahoo!").FireEvent "onmouseover"
wait 1
' Grab tooltip
ToolTip = Window("nativeclass:=tooltips_class32").GetROProperty("text")

Please, pay attention on details:

1. We use FireEvent("onmouseover") to simulate mouse placing over the link
2. Function wait(1) waits 1 second for a tool tip
3. To get tool tip text, we use:
Window("nativeclass:=tooltips_class32").GetROProperty("text")

Let's run our code and compare captured tool tip with expected ('Go to My Yahoo!'):
As you can see, above QTP script captures correct text of a Tool tip.

1 comment:

Unknown said...

Is there another language than vbScript to use QTP ?

InCisif.net

Quality Center


Quality Center

A Quality Center project is a database for collecting and storing data relevant to a testing process. For QuickTest to access a Quality Center project, you must connect to the local or remote Web server where Quality Center is installed. When QuickTest is connected to Quality Center, you can create tests and save them in your Quality Center project. After you run your tests, you can view the results in Quality Center.


Quality Center helps you maintain a project of all kinds of tests (such as QuickTest tests, business process tests, manual tests, tests created using other Mercury products, and so forth) that cover all aspects of your application's functionality. Each test in your project is designed to fulfill a specified testing requirement of your application. To meet the goals of a project, you organize the tests in your project into unique groups.

You can instruct QuickTest to automatically submit a defect to a Quality Center project for each failed step in your test. You can also manually submit a defect for a specific step to Quality Center directly from within your QuickTest Test Results window. These options are only available when you are connected to a Quality Center project.

Saving Tests to a Quality Center Project

When QuickTest is connected to a Quality Center project, you can create new tests in QuickTest and save them directly to your project. To save a test, you give it a descriptive name and associate it with the relevant subject in the test plan tree. This helps you to keep track of the tests created for each subject and to quickly view the progress of test planning and creation. In QuickTest, click Save or choose File > Save to save the test. The Save Test to Quality Center dialog box opens and displays the test plan tree.

The Save Test to Quality Center dialog box opens only when QuickTest is connected to a Quality Center project. To save a test directly in the file system, click the File System button to open the Save QuickTest Test dialog box. You can return to the Save Test to Quality Center project dialog box by clicking the Quality Center button.

Submitting Defects to a Quality Center

When viewing the results of a run session, you can submit any defects detected to a Quality Center project directly from the Test Results window.

To manually submit a defect to Quality Center: or click the Choose Tools > Quality Center ConnectionQuality Center Connection button to connect to a Quality Center project. Choose Tools > Add Defect or click the Add Defect button to open the Add Defect dialog box in the specified Quality Center project. The Add Defect dialog box opens. You can modify the defect information if required. Basic information about the test and any checkpoints (if applicable) is included in the description. Click submit button.

To automatically submit defects to Quality Center: Choose Tools > Options or click the Options button . The Options dialog box opens. Click the Run tab. Select the Submit a defect to Quality Center for each failed step check box.