Thursday 28 November 2013

Brief about object Repository in qtp


What is keyword view and Expert view in QTP?
By QTP’s Keyword Driven approach, the 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 QTP automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.

QTP stores the definitions for application objects in a file called the Object Repository.

As you record your test, QTP will add an entry for each item you interact with.

Each Object Repository entry will be identified by a logical name (determined automatically by QTP), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the QTP 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.


QTP has two types of objectrepositories for storing object information:
1) Shared object repositories and
2)
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, QTP 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 modify values in an action object repository, your changes do not have any effect on other actions. Hence, if the same test object exists in more than one action and if 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.

If I give some thousand tests to execute in 2 days what do you do?
Adhoc testing is done. It covers the least basic functionality to verify that the system is working fine.
How to "Turn Off" QTP results after running a Script?
Goto "Tools > Options > Run Tab" and Deselect "View results when run session ends". But this suppresses only the result window, but a log will be created and can be viewed manually which cannot be restricted from getting created.

Once a tester has run a test, a TestFusion report displays all aspects of the test run.

This is a high-level results overview, an expandable Tree View of the test specifying the following:
Exactly where application failures occurred,
Test data used
Application screen shots for every step that highlight any discrepancies
Detailed explanations of each checkpoint pass and failure.
By combining TestFusion reports with QTP, you can share reports across an entire QA and development team.

QTP supports which environments?
QTP 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.
What are the elements of QTP Window?
Before beginning creation of the tests,, it is essential to familiarize with the main QTP window.

The QTP window contains the following key elements:

1) Title bar: Displays the name of the currently open test.

2) Menu bar: Displays menus of QTP commands.

3) File toolbar: Contains buttons to assist you in managing your test.

4) Testing toolbar: Contains buttons to assist you in the testing process.

5) Debug toolbar: Contains buttons to assist you in debugging tests.

6) Test pane: Contains the Keyword View and Expert View tabs.

7) Active Screen: Provides a snapshot of your application as it appeared when you performed a certain step during the recording session.

8) Data Table: Assists you in parameterizing your test.

9) Debug Viewer pane: Assists you in debugging your test.
The Debug Viewer pane contains the Watch Expressions, Variables, and Command tabs.
(The Debug Viewer pane is not displayed when you open QTP for the first time.
You can display the Debug Viewer by choosing View < Debug Viewer.)

10) Status bar: Displays the status of the QTP application.
How does QTP identifies the object in the application?
QTP identifies the object in the application by LogicalName and Class.
For example: The Edit box is identified by Logical Name : PSOPTIONS_BSE_TIME20 Class: WebEdit

QTP handles those situations using "Regular Expressions.

Briefly explain the utility of Table and Database Checkpoints?
By adding table checkpoints to your tests or components, you can check:
a) That a specified value is displayed in a cell in a table on your application.
b) 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, QTP 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 QTP, by default, as well as for a variety of external add-in environments.

There are two ways to define a database query:
a) Use Microsoft Query. You can install Microsoft Query from the custom installation of Microsoft Office.

b) Manually define an SQL statement. The Checkpoint timeout option is available only when creating a table checkpoint. It is not available when creating a database checkpoint

How do you check Bitmaps?
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. QTP 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, QTP 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, QTP 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 more information on test results of a checkpoint, see Viewing Checkpoint Results.

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

The results of bitmap checkpoints may be affected by factors such as operating system, screen resolution, and color settings.

No comments:

Post a Comment