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.

Basics of QTP

How to open a new test using QTP?
1) If QTP is not currently open:
Choose Start > Programs > QuickTest Professional > QuickTest Professional.
If the Welcome window opens, click Blank Test.
Otherwise, choose File > New, or click the New button.
A blank test opens.

2) If QTP is already open:
Check which add-ins are loaded by selecting Help > About QuickTest Professional. If the Web Add-in is not loaded, you must exit and restart QTP. When the Add-in Manager opens, select the Web Add-in, and clear all other add-ins. Choose File > New, or click the New button. A blank test opens.

How to do load testing for web based Application?
1) Recording a scenario in QTP of web based application.
2) Make 100 copies of that scenario and run the test (scenario run for 100 times)
3) In that case, do the load of application on server.
4) The basic logic of running the copy 100 times is to create same scenario as if 100 users were working.

What is the extension of script and object repository files?
Object Repository : .tsr , Script : .mts, Excel : Default.xls

How to suppress warnings from the "Test results page"?
From the Test results Viewer "Tools > Filters > Warnings"...must be "Unchecked".

When we try to use test run option "Run from Step", the browser is not launching automatically why?
This is default behavior.

What's the role of Checkpoints in QTP?
A checkpoint verifies that expected information is displayed in your application while the test is running. Checkpoint is basically a point in the test, which validates for truthfulness of a specific thing in the AUT. There are different types of checkpoints depending on the type of data that needs to be tested in the AUT. It can be text, image/bitmap, attributes, XML etc....

What types of checkpoints are offered by QTP?
There are 10 types of checkpoints you can insert in QTP: 1) Standard Checkpoint checks the property value of an object in your application or Web page. The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, etc.

2) Image Checkpoint checks the value of an image in your application or Web page. For example, you can check that a selected image’s source file is correct.

3) Bitmap Checkpoint checks an area of your Web page or application as a bitmap.

4) Table Checkpoint checks information within a table. For example, suppose your application or Web site contains a table listing all available flights from one place to another. You can add a table checkpoint to check that the time of the first flight in the table is correct.

5) Text Checkpoint checks that a text string is displayed in the appropriate place in your application or on a Web page.

6) Text Area Checkpoint checks that a text string is displayed within a defined area in a Windows application, according to specified criteria.

7) Accessibility Checkpoint identifies areas of your Web site that may not conform to the World Wide Web Consortium (W3C) Web Content Accessibility Guidelines.

8) Page Checkpoint checks the characteristics of a Web page. For example, you can check how long a Web page takes to load or whether a Web page contains broken links.

9) Database Checkpoint checks the contents of a database accessed by your application.

10) XML Checkpoint checks the data content of XML documents in XML files or XML documents in Web pages and frames.

How to add a standard checkpoint in your test?
1) Start QTP and open your test. In the Open Test dialog box, locate and select your test, then click Open.
2) Save the test as Checkpoint.
Select File > Save As. Save the test as Checkpoint.
3) Confirm that the Active Screen option is enabled.
If you do not see the Active Screen at the bottom of the QTP window, click the Active Screen button, or choose View > Active Screen.
4) Locate the page where you want to add a standard checkpoint.
5) Create a standard checkpoint.
In the Active Screen, right-click element in your application and choose Insert Standard Checkpoint.
6) Save the test.

How to add a page checkpoint to your test?
The page checkpoint checks that the number of links and images in the page when you run your test is the same as when you recorded your test.

1) Locate the page where you want to add a page checkpoint.

2) Create a page checkpoint. Right-click anywhere in the Active Screen, and choose Insert Standard Checkpoint.

The Object Selection - Checkpoint Properties dialog box opens.

Note that this dialog box may include different elements, depending on where you click in the Active Screen.

3) Save the test.

How run time data (Parameterization) is handled in QTP?

You can 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. 

Wednesday 27 November 2013

Brief about QTP

If you are going for a position related to QTP, you could expect this as the first question in the interview. The first step on the part of an interviewer is to make you comfortable with a basic question.

Hence try to remember maximum portion from the following content that shouldbe presented to the interviewer if situation arises.

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

QTP is Mercury Interactive Functional Testing Tool.
Mercury QTP provides the industry's best solution for functional test and regression test automation - addressing every major software application and environment. This next-generation automated testing solution deploys the concept of Keyword-driven testing to radically simplify test creation and maintenance. Unique to QTP’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.

QTP enables you to test standard Windows applications, Web objects, ActiveX controls, and Visual Basic applications. You can also acquire additional QTP add-ins for a number of special environments (such as Java, Oracle, SAP Solutions, .NET Windows and Web Forms, Siebel, PeopleSoft, Web services, and terminal emulator applications).

QTP is based on two concepts like: a) Recording b) Playback

QTP uses VB scripting.


QTP provides three types of recording methods like:
a) Context Recording (Normal)
b) Analog Recording
c) Low Level Recording


QTP provides three types ofParameters like:
a) Method Argument
b) Data Driven
c) Dynamic



QTP testing process consist of sevensteps like: 1) Preparing to recording
2) Recording
3) Enhancing your script
4) Debugging
5) Run
6) Analyze
7) Report Defects etc.

How to Start recording using QTP?
Choose Test > Record or click the Record button.
When the Record and Run Settings dialog box opens, to do this;
1) In the Web tab, select Open the following browser when a record or run session begins.
2) In the Windows Applications tab, confirm that Record and run on these applications
(opened on session start) is selected, and that there are no applications listed.

1: If all images are like push button than you can check the property enabled or disabled. If you are not able to find that property than go to object repository for that object and click on add remove to add the available properties to that object. And if you take it as image than you need to check visible or invisible property, there are no enable or disable properties for the image object.

The Image Checkpoint does not have any property to verify the enable/disable property.

Important aspects that needs to be checked are:
a) Find out form the Developer if he is showing different images for activating/deactivating i.e. grayed out image. That is the only way a developer can show deactivate/activate if he is using an "image". Else he might be using a button having a headsup with an image.

b) If it is a button used to display with the headsup as an image you would need to use the object Properties as a checkpoint.


Select File > Save or click the Save button.
The Save dialog box opens to the Tests folder.
Create a folder which you want to save to, select it, and click Open.
Type your test name in the File name field.
Confirm that Save Active Screen files is selected.
Click Save.
Your test name is displayed in the title bar of the main QTP window.

Step-1: Start QTP and open your test.
If QTP is not already open, choose Start > Programs > QuickTest Professional > QuickTest Professional.
# If the Welcome window opens, click Open Existing.
# If QTP opens without displaying the Welcome window, choose File > Open or click the Open button.
In the Open Test dialog box, locate and select your test, then click Open.

Step-2: Confirm that all images are saved to the test results.
QTP allows you to determine when to save images to the test results.
Choose Tools > Options and select the Run tab. In the Save step screen capture to test results option, select Always.
Click OK to close the Options dialog box.

Step-3: Start running your test.
Click Run or choose Test > Run. The Run dialog box opens.
Select New run results folder.
Accept the default results folder name. Click OK to close the Run dialog box.

Monday 25 November 2013

QTP Beginners :Basic Concepts You Should Know in QTP



  • What is QTP? This is the topic you should ideally start with. You should have an idea of what QTP is all about, what type of testing you can do with QTP, different types of applications that it supports & other general stuff like what is the latest QTP version, from where you can download QTP, what are the different license modes etc.
  • What sort of Applications / Test Cases should be considered for Automation using QTP. Now this is a very important concept that must be looked at before starting with any automation project using QTP. You should be able to analyze your manual test cases and your application to see if it is can be automated or not. If it can be automated, you should be able to figure out if you’d really derive any benefit by automating the test cases.
  • Get familiar with the QTP tool. Before starting to create test scripts in QTP, you should be familiar with the QTP tool. You should be aware of the different panes and controls in the QTP window. You should know what they are and for what purpose they are used.
  • Test Objects and Object Repositories. You should know what are test objects, what is object hierarchy, how you can identify objects using QTP and how you can identify unique properties for your objects. You should also know what object repositories are, why they are used and how you can use them to add objects.
  • Creating Test Scripts / Actions. Now comes the real scripting part. You should be able to use the record & playback method to create & run test cases. Together with record & playback method, you should be able to ‘write’ your code after associating object repositories to your actions.
  • Analyzing your Test Run Results. Once you run your test scripts, you should be able to analyze the test run results. You should be able to find out which steps have passed & which have failed. You should also be able to identify the test case flow using the run results.
  • Creating Functions & Using Function Libraries. You should be able to identify reusable flows & functionality in your test cases. You should be able to write user defined functions for the reusable flows. You should also be able to create new function libraries, add some reusable functions to these function libraries and use these functions in your script by associating the function libraries to your test script.
  • Working with Data Tables. You should know how you can use data table to pass on data values in your test script. You should also be aware of how you can take data from excel sheets and use it in your scripts.
  • Basics of Debugging. You should have a clear understanding of the basic debugging techniques in QTP. You should know how to use breakpoints in your code. You should also know how you can make use of the debug viewer pane while running your test scripts