What QTP Features9.0 to 10.0

33
Quick Test Professional What’s New in Quick Test Pro 9.0 Object Repository Manager You can use the Object Repository Manager to manage all of the shared object repositories in your organization from one, central location. This includes adding and defining objects, modifying objects and their descriptions, parameterize test object property values, maintaining and organizing repositories, and importing and exporting repositories in XML format. You can open multiple object repositories at the same time. Each object repository opens in its own resizable document window. This enables you to compare the content of the repositories, to copy or move objects from one object repository to another, and so forth Object Repository Merge Tool You can use the Object Repository Merge Tool to merge the objects from two shared object repositories into a single shared object repository. You can also use the Object Repository Merge Tool to merge objects from the local object repository of one or more actions or components into a shared object repository. When you merge objects from two source object repositories, the content is copied to a new, target object repository, ensuring that the information in the source repositories remains unchanged. If any conflicts occur during the merge, for example, if two objects have the same name and test object class, but different test object descriptions, the relevant objects are highlighted in the source repositories, and the Resolution Options pane details the conflict and possible resolutions. Multiple Object Repositories per Action or Component Quick Test provides several options for storing and accessing test objects. You can store the test objects for each action or component in its corresponding local object repository, which is unique for each action and component. You can also store test objects in one or more shared object repositories that can be used in multiple actions and components. Alternatively, you can use a combination of objects from the local object repository and one or more shared object repositories. You choose the combination that matches your testing needs. XML Object Repository Format Quick Test now enables you to import and export object repositories from and to XML format. This enables you to modify object repositories using the XML editor of your choice and then import them back into Quick Test. You can import and export files either from and to the file system or a Quality Center project (if Quick Test is connected to Quality Center). Function Library Editor Quick Test now has a built-in function library editor, which enables you to create and edit function libraries containing VBScript functions, subroutines, modules, and so forth, and then call their functions from your test or component. You can create, open, and work on multiple function libraries simultaneously. Each function library opens in its own document window. When working with a function 1

Transcript of What QTP Features9.0 to 10.0

Page 1: What QTP Features9.0 to 10.0

Quick Test Professional What’s New in Quick Test Pro 9.0

Object Repository Manager

You can use the Object Repository Manager to manage all of the shared object repositories in your organization from one, central location. This includes adding and defining objects, modifying objects and their descriptions, parameterize test object property values, maintaining and organizing repositories, and importing and exporting repositories in XML format. You can open multiple object repositories at the same time. Each object repository opens in its own resizable document window. This enables you to compare the content of the repositories, to copy or move objects from one object repository to another, and so forth

Object Repository Merge Tool

You can use the Object Repository Merge Tool to merge the objects from two shared object repositories into a single shared object repository. You can also use the Object Repository Merge Tool to merge objects from the local object repository of one or more actions or components into a shared object repository. When you merge objects from two source object repositories, the content is copied to a new, target object repository, ensuring that the information in the source repositories remains unchanged. If any conflicts occur during the merge, for example, if two objects have the same name and test object class, but different test object descriptions, the relevant objects are highlighted in the source repositories, and the Resolution Options pane details the conflict and possible resolutions.

Multiple Object Repositories per Action or Component

Quick Test provides several options for storing and accessing test objects. You can store the test objects for each action or component in its corresponding local object repository, which is unique for each action and component. You can also store test objects in one or more shared object repositories that can be used in multiple actions and components. Alternatively, you can use a combination of objects from the local object repository and one or more shared object repositories. You choose the combination that matches your testing needs.

XML Object Repository Format

Quick Test now enables you to import and export object repositories from and to XML format. This enables you to modify object repositories using the XML editor of your choice and then import them back into Quick Test. You can import and export files either from and to the file system or a Quality Center project (if Quick Test is connected to Quality Center).

Function Library Editor

Quick Test now has a built-in function library editor, which enables you to create and edit function libraries containing VBScript functions, subroutines, modules, and so forth, and then call their functions from your test or component. You can create, open, and work on multiple function libraries simultaneously. Each function library opens in its own document window. When working with a function

1

Page 2: What QTP Features9.0 to 10.0

Quick Test Professional library, another testing document, such as a test, application area, or component, is always open, enabling you to add calls to your functions as you create or modify them. By creating and working with function libraries directly in Quick Test, you can take advantage of Quick Test’s Expert View-like editing features, syntax checker, debug features, and so forth. For example, you can step directly into the function code in a function library while debugging a test or component. You can also use the Function Definition Generator to generate definitions for new user-defined functions, add header information to them, and register these functions to a test object, if needed. You can then complete the function by adding its content (code). You can associate a function library directly with a test or application area, to make its functions available to all of a test’s actions, or to all of an application area’s associated components. By implementing user-defined functions in function libraries and associating them with your test, you and other users can choose functions that perform complex operations, such as adding if/then statements and loops to test steps, or working with utility objects—without adding the code directly to the test. In addition, you save time and resources by implementing and using reusable functions.

Handling Missing Actions and Resources

Whenever a testing document (test, component, or application area) contains a resource that cannot be found, Quick Test opens the Missing Resources pane and lists the missing resource(s). For example, a test may contain an action or a call to an action that cannot be found; a testing document may use a shared object repository that cannot be found; or a testing document may use an object repository parameter that does not have a default value. In all of these cases, Quick Test indicates this in the Missing Resources pane, enabling you to map a missing resource to an existing one, or remove it from the testing document, as required.

New Supported Operating System Versions

Quick Test now supports the following operating system:

• Windows 2000—Service Pack 4 • Update Rollup 1 for Windows 2000 Service Pack 4 • Windows XP 32-Bit Edition—Service Pack 2 • Windows XP 64-Bit Edition—Service Pack 1 • Windows Server 2003 32-Bit Edition—Service Pack 1 • Windows Server 2003 R2 (32-Bit x86)

New Supported Browsers and Browser Versions

In addition to support for recording tests and components on Microsoft Internet Explorer, Quick Test now supports running tests and components on the following new Web browser versions:

• Microsoft Internet Explorer 7.0 • Netscape Browser 8 • Mozilla Firefox 1.5

2

Page 3: What QTP Features9.0 to 10.0

Quick Test Professional Improved Menus and Toolbars

The Quick Test menus and toolbars contain more intuitive categories and new commands to help you better manage your Quick Test sessions. For example, the Automation menu contains all of the commands that are related to recording and running your tests and components, as well as viewing the run results. The Resources menu contains all of the commands that are relevant for managing your object repositories, and for viewing associated function libraries. The File menu enables you to set document-specific settings, manage your testing documents, connect to your Quality Center project, associate function libraries with your testing document, and so forth.

New and Enhanced Expert View and Function Library Editor Options

You can use the following new options and enhancements when working in the Expert View or Function Library editor:

Syntax Errors

You can check for syntax errors at any time by using the new Check Syntax command. If syntax errors are identified, they are displayed in the Information Pane in the bottom left corner of your screen (configurable). You can jump directly to the statement line for each error so that you can correct it. As in the previous release, when you select to switch to the Keyword View from the Expert View, Quick Test checks whether there are syntax errors in your statements. Quick Test displays the Keyword View only after all syntax errors have been corrected.

Comment/Uncomment

You can now comment and uncomment individual statements or entire sections in your action using the new Comment Block and Uncomment Block commands. This enables you to comment out sections while debugging your actions, for example, as well as providing an additional way to implement comments.

Indent/Outdent

You can now indent and individual statements or blocks of statements using the new Indent and Outdent commands. This helps make your test actions more readable and easier to maintain.

Action Parameter Enhancement

In addition to specifying test or action parameters to pass values to and from your test, and between actions in your test, you can now use action parameters to pass values between sibling actions (actions at the same hierarchical level).

Debugging Enhancements

You can use the following new options and enhancements when debugging your tests, components, and function libraries:

3

Page 4: What QTP Features9.0 to 10.0

Quick Test Professional New Step Commands

In addition to the Step Into, Step Over, and Step Out options, you can now instruct QuickTest to start a debug session from a particular step using the Start from Step command, or to run the debug session from the current step until it reaches a particular step using the Run to Step commands.

Run Current Action You can also use the Run Current Action option to run a single action in your test. Enhanced Breakpoint Support

You can now insert and remove breakpoints in the Keyword View by clicking in the margin to the left of a statement in your testing document. You can also enable and disable breakpoints as you debug different parts of your action, component, or function library. This enables you to temporarily ignore breakpoints without removing them as you debug the various parts of your test, component, or function library.

Added Control of the Object Repository from Run Session and QuickTest Automation Scripts

Quick Test provides a new Repository reserved object that enables you to set or retrieve the value of object repository parameters for the current run session. The Quick Test Professional automation object model provides a new Object Repositories collection object that enables you to control the object repositories associated with actions. For example, when you create a new object repository for a new product module, you can use an automation script to associate the new object repository with the actions of all relevant tests.

Checkpoint and Output Value Renaming Capabilities

When you create a checkpoint or output value, by default, its name is the name of the test object on which the checkpoint or output value step is performed. QuickTest now enables you to rename checkpoints and output values in your test. This can make it easier, for example, to see the purpose of the checkpoint or output value step without opening the checkpoint or output value dialog box.

Test Results Enhancements

You can now export run results to an HTML file to save them in HTML format. This is useful, for example, if you want to send the HTML file containing the run session results in an e-mail to a third-party who does not have QuickTest installed. You can choose to export the entire report to an HTML file, or just a part of it. You can also modify the theme of the Test Results window, just like you can for the main QuickTest window.

4

Page 5: What QTP Features9.0 to 10.0

Quick Test Professional

What’s New in Quick Test Pro 9.1

Object Repository Comparison Tool

The new Object Repository Comparison Tool is accessible from the Object Repository Manager. You can use this tool to identify the differences between objects in two specified shared object repository files. It also enables you to track changes in different versions of the same shared object repository file. After the compare process, the Comparison Tool provides a graphic representation of the objects in the object repositories, indicating objects that have differences, as well as objects that are unique to one repository. You can also view the properties and values of each object in the repositories. During the comparison process, the original object repository files remain unchanged

Object Repository Automation

You can use the objects and methods of the QuickTest Object Repository automation object model to write scripts that automatically manipulate object repositories, instead of performing these operations manually using the Object Repository Manager. For example, you can add, remove, and rename test objects, import from and export to XML, and retrieve and copy test objects. The QuickTest Professional Object Repository Automation Reference is a Help file that provides detailed descriptions, syntax information, and examples for the objects and methods in the QuickTest object repository automation object model. You can write your automation scripts in any language and development environment that supports automation.

New Environment Support

QuickTest Professional 9.1 supports the following new infrastructure software, operating system, and Web browser versions:

• QuickTest now runs under Microsoft .NET Framework 2.0. If it is not currently installed on the computer on which you are installing QuickTest, Setup prompts you to install it before continuing the installation. On-screen instructions are provided.

• QuickTest now provides Beta-level support for Microsoft Windows Vista Beta 2.

• QuickTest now provides Beta-level support for Microsoft Internet Explorer 7.0 Beta 3.

• QuickTest now provides Alpha-level support for Bon Echo version 2.0a3 (Mozilla Fire fox 2.0 Alpha).

Newly Integrated Tools

The QuickTest Script Editor and Business Component Upgrade Tool are now installed automatically when you install QuickTest Professional 9.1.

5

Page 6: What QTP Features9.0 to 10.0

Quick Test Professional

Whats New In QTP 9.5

• Start Page

• Function Library

• Information Pane

• Available Keywords Pane

• Test Flow Pane

• Resources Pane

• Missing Resources Pane

• Process Guidance Panes

� Maintenance Run Mode:

Repair your test on the fly, this will assists you to adding the steps or uodating the object proprties in OR on the fly.i.e. if your object properties are changed after a new build, you just run the Maintenance Run Mode and update your OR according to that on the fly.

� Process Guidance :

This is little more than more accessible help files. Maybe this is good for when you are first learning to record a test, but it doesn’t seem to add much utility.

� Flow Pane

� Available Keywords Pane

All Test Objects and functions in one handy location.Rapid test development with drag & drop.Object repository now also supports drag & drop

6

Page 7: What QTP Features9.0 to 10.0

Quick Test Professional � Resources Pane :

All resources associated with the test. You can see all your library file in this pane

� Missing Resources Pane � Relative Path Helper � Improved Bitmap Checkpoint � Web Extensibility: 1. Anyone can add support for new web controls 2. Rapid development in JavaScript 3. Solid infrastructure supplied by the Web add-in 4. Extensibility objects are first class citizens 5. Built-in toolkit: ASP Ajax � Tabbed browsing: Tabs identified as separate browsers.Same test compatible with tabbed and non tabbed browsers. � New Technologies : 1.PowerBuilder 2. Oracle − Forms 10 −Apps 12 3.StingRay Objective Grid 10, 114. PeopleSoft 9.0• 4.New Terminal Emulator versions 5.NET 3.5 (beta) � New environments: 1.Windows Vista 64 bit 2. Eclipse 3.2, 3.3 3.Record on SWT 4. Firefox 3.0 5.Netscape 9

7

Page 8: What QTP Features9.0 to 10.0

Quick Test Professional

QTP 10.0 Features

1. QC integration – Which (mostly) down to Resource Management and Source

Resource Management: Although you could keep saving your resources as attachments (for backward compatibility), you can upgrade to a new, fuller mode of work. This includes a whole new Resource module in QC, and allows for some very neat tricks on Function Libraries, Tests and Object Repositories etc.

It should be noted, though, that other types of files (external excel / XML files, for example), remain as unmanaged attachments.

Resources have full meta-data, and have a special view pane – you can view Object-Repositories, data-tables, and function libraries code right from QC. This looks quite nice; however, I missed the ability to open the resource for editing in QTP with a single click.

Automatically updated path system – When moving a function library between folders, QC will automatically update all the tests which depend on it, so they will use it at its new location. This makes the once critical problem of hard-path-link a non-issue. Very impressive.

A word about the user interface – when opening a QC resource / test from QTP, the file dialog shows the items with large, crisp icons, very similar to Word’s save dialog. Everything is very clear and intuitive, as is the ability to revert back to saving / opening a test from the File-System.

What about your existing projects? Well, when upgrading to QC 10, a wizard will automatically transform all you unmanaged attachments to managed resources (if you’d like it to).

Source Control: This includes a very rich line of features which are very well executed, and effectively allow you to manage a QTP project as any other code project:

First, the basics – QTP and QC 10 introduce a new Check-in/Check-out ability. It works similar to what you’d expect – a checked out item will be locked to all other users, and you can immediately know an item’s status by looking at its icon (green/red locks).

An interesting twist regards manner in which a test / resource is locked – it’s at the user level (not the local machine level). This means that if you log into QC from a different machine, you’ll have access to all your checked-out items, even if they were originally checked-out on a different local machine. The ability is implemented very well, both from QTP’s end, as well as from QC’s end.

A major enabler for source control is the new versioning feature of QC. It manifests both with a kind of instant versioning for a single resource, and with a project-wide “base-line version”, which allows you to revert your entire test framework to a previous version. Both types of versioning are supported by a

8

Page 9: What QTP Features9.0 to 10.0

Quick Test Professional surprisingly robust comparison mechanism. You can select two versions of a resource / test, a see a very detailed comparison of their respective changes. For function libraries this amounts to a “simple” text comparison, but this feature truly shines in full test comparisons.

It will present changes in the different actions and their resources (data-table, object repositories, inner code), as well as in the global test-settings, associated function libraries, recovery scenarios, and pretty much anything you could think of. The ability to drill-down into the data is very impressive; and the effective, concise manner in which the data is presented in the top level view is downright unbelievable. A nice touch is a small screen capture of the change, in case you don’t remember what “Run all rows –>Changed into-> Run a single iteration only” means (for example).

Now to the versioning mechanism itself: Whenever you check and item in, a new “version” will be created, and you’ll be able to revert back to it with ease. As this is a version of a single, isolated resource, I found it better to refer to it as a SnapShot – my terminology, not HP’s. The snapshots are visible both from QC and QTP, and you can very easily choose which one to open. This allows you a kind of an instant undo to a single file which worked in the past, but is broken in the present.

The second mechanism presents the ability to select several folders, and create a full blown “base-line version” of them and everything they relate to. Defects, inner-connections, tests, history data, resources – all these and more will be “frozen” and preserved as a base-line. You can then choose to revert back to an old baseline, and truly regain all the abilities that were present at that time. As all the resources, attachments tests and reports will be restored, you don’t have to worry about forgetting anything, or leaving some minor resource at the wrong version. This is versioning with a vengeance – it allows you to track the AUT’s versions with your own automation versions, enabling, among other things, running automation efforts on several AUT versions at once.

For conclusion – The new abilities inherit in the connection of QTP and QC Atlantis are (or at least seem to be) revolutionary. At last, QTP projects can be natively managed as code projects; and some of the supporting infrastructure is surprisingly robust and useful. As a “raving” anti-QC-ist, I must admit QC Atlantis seem tempting, and for me, that’s saying a lot!

I must contrast these very positive impressions with some dire problems: The versioning feature will put a stain on your storage capabilities (though less than creating a simple copy the data); all these wonderful features are available only if both your QTP and QC are upgraded to Atlantis; and a critical issue – Previous versions of QTP will not work with QC Atlantis. Yes, this is not a misunderstanding, there is no backward compatibility between QC to QTP (although QTP Atlantis will work with any version of QC). On top of these, performance may become an issue, though we were unable to precisely evaluate it, as our QC was installed on an already overtaxed personal computer.

2. Report improvements

The native QTP report includes several new improvements:

9

Page 10: What QTP Features9.0 to 10.0

Quick Test Professional Tracability: Selecting a report-node will automatically focus on the relevant code-line in the script. This may sound like a cool feature at first, but a closer look revels that it only works for actions (not functions); and that in any case, using a custom report function (as most of us do) completely nullifies the feature (since you’re always at the same code line when performing the report).

Exporting: The report now has a two-click export feature, which comes with a built-in ability to export to Word and PDF documents, as well as the ability to export through a custom XSL of your choosing. You can choose between Short and Long formats (corresponding to PShort.XSL and PDetails.XSL) to get a document relevant to your needs. This blessed feature has one major flaw – It has no API support. This means that you cannot export the results automatically at the end of a test run, which is quite a miss, to say the least.

Resource Monitor: QTP can now hook onto the Windows Performance Monitor and present it as part of the test results. You can select several counters to monitor (e.g. GDI objects, memory usage etc.), and the monitor output graph will be available in special tab in the result window. You can set up a “checkpoint” for a counter (e.g. Fail the test if there are more than 500 GDI objects), facilitating a kind of a poor-man’s version of load-testing.

The fact that clicking the graph focuses on the relevant test step (as well as the other way around), provides an effective way to quickly locate problematic actions and resource usage spikes. This feature is well executed, and HP has even went the extra mile and added several unified counters that simplify monitoring the application. However, the fact that you can only monitor one process per test may leave the more advanced users with their own implementation of a resource monitor.

Considering the simple design and implementation of this feature, I believe it will become a popular tool in every automation project that uses QTP 10.

Native image integration: This is a small, yet long-awaited feature. The ReportEvent command now has a new optional parameter – you can specify a path to a picture file, and it will be attached to the report node of the current event. When used in conjunction with the CaptureBitmap method, this presents a technical, yet revolutionary upgrade to the native QTP report. Finally, users can attach screenshots to their custom report events without any special functions or frameworks.

3. IDE improvements

Intellisense: Perhaps I’m doing injustice to the other features, but the IDE improvements, and the new intellisense engine in particular, is what got me excited about QTP Atlantis. So I was pretty much on the edge of my seat when we’ve gotten to this last part of the presentation. I’m very pleased to say that it was every bit what I imagined it to be, with the exception of intellisense for VBScript classes, and intellisense in the debug viewer (both won’t be implemented). Luckily, there are workarounds for both these issues through the PDM hack (for debug intellisense), and WSC registration (for VBScript Class intellisense through COM).

We saw a demonstration of how creating an Excel COM object provided a full intellisense for all its methods and properties, for as many levels as we’d like. Every variable set to this object also presented the same intellisense, and the autocomplete

10

Page 11: What QTP Features9.0 to 10.0

Quick Test Professional caught every variable we’ve defined or used (yes, there’s autocomplete for variable names!). The autocomplete and intellisense features worked smoothly, and presented no apparent performance issue. It’s still left to be seen how it functions in a real script, with hundreds / thousands code lines.

Tasks and Comment Pane: QTP has a new bottom pane which includes a run-of-the-mill implementation of tasks and comments. Double clicking a comment will take you to the relevant code-line, though strangely enough, you cannot do this with a task (i.e., tasks cannot be linked to specific code lines). It was mentioned that enabling the comments feature for function libraries may sometimes cause performance issues.

Dynamic code-zones: When standing inside a code block like If, While, Do, etc, the IDE will mark the relevant block with blue lines, making it much more easy to make your way inside nested blocks of this sort (somewhat like highlighting left-right bracket pairs). While it will surely make our life easier, a more robust mechanism like collapsible code-regions is still needed.

Custom Toolbars: You can add your own buttons and commands to QTP toolbars and menus. While this does not include inner-QTP macros, you can assign a program / File shortcut to your own button / menu item. It’s nice, but i think it will only gain power once QTP’s inner mechanisms will be bindable to such buttons.

4. Miscellaneous features

General look and feel: QTP has departed from the old Tab layout, and into the more modern settings-tree layout (similar to Office, EMule, Adobe, and pretty much every other program). It’s nice, but nothing as groundbreaking as the transformation in QTP 9.0.

Bitmap Checkpoint improvements: These include presenting the size of the selected area when choosing to check only a part of an Image, as well as the ability to plug your own custom DLL for comparing images. I suppose that there are some projects for which this can actually be quite revolutionary. Another great addition is the ability to see the difference between the expected and actual bitmaps in a separate tab.

API changes: QTP Automation API will receive several upgrades, the most noteworthy of which is the ability to read and write that code of the test you’ve opened. Writing the code will not effect an ongoing run-session (there goes my ambitious try-catch implementation for QTP), but it still opens the door for some creative tweaks and hacks…

Saving a test with all linked resources: For those who’re working with QC, this is a real blessing. Up until QTP 10, copying a QC saved test to your local system was a hellish procedure of changing each and every resource and action reference to your local file-system. QTP and QC Atlantis offer a one-click solution for copying a test and all its resources to your local file-system, and automatically changing all the references accordingly.

11

Page 12: What QTP Features9.0 to 10.0

Quick Test Professional Dynamic Action Call: I’ve saved the best for last. QTP 10 presents a new native command – LoadAndRunAction. It allows you to load external actions during the run-session, without having to associate them with your test beforehand. All the run-time debug abilities will be available for these dynamically added actions, so you’re not giving anything up by using this feature. I think it’s a long awaited feature, and a well executed one.

What surprises are in store in QTP?

1. Stronger than ever Quality Center integration.

An external resources manager: No more hellish workarounds for saving resources as attachments (function libraries, shared OR etc.). From now on, an external resource will become a fully-fledged QC entity, with its own meta-data (which means it’s searchable!), fields and versions.

Versions: QTP tests and all the external resources will now have full versioning support. This will include reverting back to an old version (immediately, from the open file menu if you’d wish), as well as comparing versions - from the attached resources of the tests, though the objects in the SOR, to the changed lines in the function library files. Versioning is available for manual tests as well, thus allowing for a very smooth integration of automation with manual testing.

I must say that this is one feature I would consider migrating my tests to Quality Center for.

2. Intellisense

It’s a known fact that the QTP intellisense popup can be quite annoying – just when you’re dealing with a very complex .Net/Java object, the window proves to be too narrow to fully display the object’s properties and methods. Tarun has continued his great work on providing productivity enhancing tools and code libraries, and has posted a resizer for the intellisense popup window.

COM objects intellisense - for example, if you’d use an Excel.Application object, you’d see all its inner methods and properties, up to the N-th level

Variable bridge intellisense - which means that if you’d assign some object to a variable, the variable will have the same intellisense as the original object

These three abilities present the bulk of abilities you would like to have in an intellisense system. It’s not that there isn’t room for more abilities, but these three are sure to make working with the new QTP an entirely different experience. It’s unclear if this would include auto-complete for script variables, but my guess is that it will.

I was told that all these intellisense features will not apply to VBScript classes, but only to COM objects and RO objects. As one who relays heavily on my own VBScript classes, I was very disappointed. However, it must be said that not a lot of QTP programmers work with their own VBScript classes, so it’s a shortcoming that only a handful of people should mind.

12

Page 13: What QTP Features9.0 to 10.0

Quick Test Professional

3. More IDE improvements

These include the integration of a comment driven To-Do pane, as well as a jump-to-comment ability. Not anything out of the ordinary, but a blessed addition to the very limited QTP IDE environment. Further more, and three versions too late – Toolbar customizations! You could rearrange existing icons, as well as add calls to external commands (e.g. launch the AUT) as separate icons.

4. Reporter improvements

The reporter will now be able to natively export the HTML to PDF (and perhaps some other formats).

A completely new feature will be an integrated performance counter which would monitor the computer resources throughout the test. This, combined with a new ability to jump to the relevant script live from the report will facilitate a whole new level of testing – almost like a poor-man’s version of a load test.

However, there’s still no word on filtering, searching, and running several reporters concurrently (although the infrastructure exists since QTP 8.2). Another overlooked issue is the report’s availability in case of a mid-run crash.

5. New checkpoint abilities

You could set up a whole new kind of checkpoint for the computed resources – for example, fail the test if the application uses more than 500 GDI objects, and other parameters. This ability is closely coupled with the new resource monitor report. Another welcomed improvement is the ability to hook up your own algorithm for image comparison straight into QTP’s native image checkpoint mechanism.

6. New environments

It will include at least: Windows XP SP3, Windows 2008, Windows Vista SP1, IE8, FireFox 3, the new cirtrix client.

PRODUCT ENHANCEMENTS

Upgrade from QuickTest 9.5 - If you have QTP 9.5 Installed on the system, you can choose to upgrade to version 10.0. This will allow you to preserve some of the configuration settings and options that you already have set up.

Improved IntelliSense Functionality - QTP now provides full IntelliSense for objects created by a step or function (i.e. objects created by Create Object method), variables to which an object is assigned, reserved objects, COM objects and properties that return objects. In addition, Intellisense sentence completion now provides lists of local variables.

Added Control for Editing and Managing Actions in Automation Scripts - The QTP Automation Object Model has a new set of objects and methods for manipulating

13

Page 14: What QTP Features9.0 to 10.0

Quick Test Professional test actions and action parameters. You can use automation scripts to create new actions, modify and validate the syntax of action scripts, create and modify action parameters, and more.

Improved Debugger Pane Design and Functionality - The Debug Viewer pan has a new look, including icons to help you identify the type of information displayed.

New Object Identification Solutions in Maintenance Run Mode - In addition to helping you update your steps and object repositories when objects in application change, the Maintenance Run Wizard can now help you solve problems dealing with test failures due to missing objects, or objects that can only be recognized via Smart Identification.

Additional Configuration Settings for Text Recognition Mechanism - You can now set all text recognition configuration settings from the QuickTest Options Dialog Box

New Look for Options, Settings, and File Dialog Boxes - The QuickTest Options and Settings dialog boxes have changed from their former ta-based design to a more easily navigable tree-based structure. The tree contains only the options relevant for the add-ins that are currently loaded.

QuickTest Toolbar Customization Options - You can use the new Customize Dialog box to customize the appearance of existing menus and toolbars, and to create your own user-defined menus, toolbar buttons, and shortcuts.

Improved Web Extensibility - QTP Web Add-in Extensibility enables you to develop packages that provide high level support for thir-party and custom Web controls that are not supported out-of-the-box by the Web Add-in.

NET Add-in and Extensibility Improvements - The .NET Add-in has several new objects and methods, including the SwfPropertyGrid test object (for working with .NET Windows Forms property grids), GetErrorProviderText method and ErrorProviderText identification property.

New Terminal Emulator Configuration Validation - The new Terminal Emulator pane of the Options dialog box now includes a Validate button. When you click this button, QTP checks the current configurations of the selected emulator. If a problem is detected, a brief description is displayed in the pane.

NEW SUPPORTED OPERATING SYSTEMS AND ENVIRONMENTS

Microsoft Windows 2008 Server 32-bit Edition Microsoft Windows 2008 Server 64-bit Edition Microsoft Windows Vista, Service Pack 1, 32-bit Edition Microsoft Windows Vista, Service Pack 1, 64-bit Edition Microsoft Windows XP Professional 32-bit Edition -- Service Pack 3 Citrix Presentation Server 4.5 Microsoft Internet Explorer 8, Beta 2 Mozilla firefox 3.0.x

14

Page 15: What QTP Features9.0 to 10.0

Quick Test Professional

Delphi: IDE, versions 6, 7, and 2007 (for controls based on the Win32 VCL library)

SAP: CRM 2007 (For controls that support test mode enhancements Java: IBM 32-bit JDK 1.5.x, SWT toolkit version 3.4 Java Extensibility: Eclipse IDE 3.4 NET: .NET Framework 3.5 -- Service Pack 1

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.

15

Page 16: What QTP Features9.0 to 10.0

Quick Test Professional 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.

16

Page 17: What QTP Features9.0 to 10.0

Quick Test Professional

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.

GET NAMES OF ALL OPEN BROWSERS

Set browserDesc = Description.Create() browserDesc("application version").Value = "internet explorer 6" Set browserColl = DeskTop.ChildObjects(browserDesc) browserCnt = browserColl.Count MsgBox "There are " &browserCnt& " instances of a browser" For i = 0 To (browserCnt -1) MsgBox "Browser # " &i& " has title = " & browserColl(i).GetROProperty("title") Next Set browserColl = Nothing Set browserDesc = Nothing

Descriptive programming

When and Why to use Descriptive programming?

Below are some of the situations when Descriptive Programming can be considered useful:

1. The objects in the application are dynamic in nature and need special handling to identify the object. The best example would be of clicking a link which changes according to the user of the application, Ex. “Logout <>”.

2. When object repository is getting huge due to the no. of objects being added. If the size of Object repository increases too much then it decreases the performance of QTP while recognizing a object.

3. When you don’t want to use object repository at all. Well the first question would be why not Object repository? Consider the following scenario which would help understand why not Object repository Scenario 1: Suppose we have a web application that has not been developed yet. Now QTP for recording the script and adding the objects to repository needs the application to be up, that would mean waiting for the application to be deployed before we can start of with maki! ng QTP scripts. But if we know the descriptions of the objects that will be created then we

17

Page 18: What QTP Features9.0 to 10.0

Quick Test Professional can still start off with the script writing for testing Scenario 2: Suppose an application has 3 navigation buttons on each and every page. Let the buttons be “Cancel”, “Back” and “Next”. Now recording action on these buttons would add 3 objects per page in the repository. For a 10 page flow this would mean 30 objects which could have been represented just by using 3 objects. So instead of adding these 30 objects to the repository we can just write 3 descriptions for the object and use it on any page.

4. Modification to a test case is needed but the Object repository for the same is Read only or in shared mode i.e. changes may affect other scripts as well. 5. When you want to take action on similar type of object i.e. suppo! se we have 20 textboxes on the page and there names are in the form txt_1, txt_2, txt_3 and so on. Now adding all 20 the Object repository would not be a good programming approach. How to use Descriptive programming? There are two ways in which descriptive programming can be used

1. By creating properties collection object for the description.

2. By giving the description in form of the string arguments.

1. By creating properties collection object for the description. To use this method you need first to create an empty description Dim obj_Desc ‘Not necessary to declare

Set obj_Desc = Description.Create

Now we have a blank description in “obj_Desc”.

Each description has 3 properties “Name”, “Value” and “Regular Expression”.

obj_Desc(“html tag”).value= “INPUT”

When you use a property name for the first time the property is added to the collection and when you use it again the property is modified. By default each property that is defined is a regular expression. Suppose if we have the following

description obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt.*”

This would mean an object with html tag as INPUT and name starting with txt. Now actually that “.*” was considered as regular expression. So, if you! want the property “name” not to be recognized as a regular expression then you need to set the “regularexpression” property as FALSE

obj_Desc(“html tag”).value= “INPUT”

obj_Desc(“name”).value= “txt.*” o

bj_Desc(“name”).regularexpression= “txt.*”

This is how of we create a description. Now below is the way we can use it

18

Page 19: What QTP Features9.0 to 10.0

Quick Test Professional Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test”

When we say .WebEdit(obj_Desc) we define one more property for our description that was not earlier defined that is it’s a text box (because QTPs WebEdit boxes map to text boxes in a web page). If we know that we have more than 1 element with same description on the page then we must define “index” property for the that description Consider the HTML code given below

Now the html code has two objects with same description. So distinguish between these 2 objects we will use the “index” property.

Here is the description for both the object

For 1st textbox:

obj_Desc(“! html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name” obj_Desc(“index”).value= “0” For 2nd textbox: obj_Desc(“html tag”).value= “INPUT” obj_Desc(“name”).value= “txt_Name” obj_Desc(“index”).value= “1” ! Consider the HTML Code given below:

We can use the same description for both the objects and still distinguish between both of them

obj_Desc(“html tag”).value= “INPUT”

obj_Desc(“name”).value= “txt_Name”

When I want to refer to the textbox then I! will use the inside a WebEdit object and to refer to the radio button I will use the description object with the WebRadioGroup object.

Browser(“Browser”).Page(“Page”).WebEdit(obj_Desc).set “Test” ‘

Refers to the text box Browser(“Browser”).Page(“Page”).WebRadioGroup(obj_Desc).set “Test” ‘

Refers to the radio button But if we use WebElement object for the description then we must define the “index” property because for a webelement the current description would return two objects. Hierarchy of test description: When using programmatic descriptions from a specific point within a test object hierarchy, you must continue to use programmatic descriptions from that point onward within the same statement. If you specify a test object by its object repository name after other objects in the hierarchy have been described using programmatic descriptions, QuickTest cannot identify the object.

For example, you can use Browser(Desc1).Page(Desc1).Link(desc3),

19

Page 20: What QTP Features9.0 to 10.0

Quick Test Professional since it uses programmatic descriptions throughout the entire test object hierarchy. You can also use

Browser(”Index”).Page(Desc1).Link(desc3),

since it uses programmatic descriptions from a certain point in the description (starting from the Page object description). However, you cannot use

Browser(Desc1).Page(Desc1).Link(”Example1″),

since it uses programmatic descriptions for the Browser and Page objects but then attempts to use an object repository name for the Link test object (QuickTest tries to locate the Link object based on its name, but cannot locate it in the repository because the parent objects were specified using programmatic descriptions).

Getting Child Object:

We can use description object to get all the objects on the page that matches that specific description. Suppose we have to check all the checkboxes present on a web page. So we will first create an object description for a checkboxe and then get all the checkboxes from the page

Dim obj_ChkDesc Set obj_ChkDesc=Description.Create obj_ChkDesc(“html tag”).value = “INPUT” obj_ChkDesc(“type”).value = “checkbox” Dim allCheckboxes, singleCheckBox Set allCheckboxes = Browse(“Browser”).Page(“Page”).ChildObjects(obj_ChkDesc) For each singleCheckBox in allCheckboxes singleCheckBox.Set “ON” Next

The above code will check all the check boxes present on the page.!

To get all the child objects we need to specify an object description i.e. we can’t use the string arguments that will be discussed later in the 2nd way of using the programming description. Possible Operation on Description Object Consider the below code for all the solutions

Dim obj_ChkDesc Set obj_ChkDesc=Description.Create obj_ChkDesc(“html tag”).value = “INPUT” obj_ChkDesc(“type”).value = “checkbox”

Q: How to get the no. of description defined in a collection

A: obj_ChkDesc.Count ‘Will return 2 in our case

20

Page 21: What QTP Features9.0 to 10.0

Quick Test Professional How to return the total number of links in a webpage and their names and URLs

Solution: Use ChildObjects to get the link collection, then retrieve the properties

Use the ChildObjects method to retrieve all the links on the specified webpage. Once you have the collection, you can use the GetROProperty method to retrieve the innertext (name) and href (URL) values. object.ChildObjects (pDescription) object A Page or Frame object.

pDescription The description of the object to retrieve. Use the Description object to store the description of the object type to retrieve.

Example: ‘ The sample was created against www.google.com

Set oDesc = Description.Create() 'Retrieve HTML tag <A> oDesc("html tag").Value = "A" Set rc = Browser("Google").Page("Google").ChildObjects(oDesc) num = rc.Count() For i=0 to num-1 tag = rc(i).GetROProperty("innertext") href = rc(i).GetROProperty("href") Reporter.ReportEvent 0, "Links in Page", "name: " & tag &"; url:" & href Next

Dictionary Object

Dictionary Object stores data key, item pairs. A Dictionary object stores the items in the array. Each item is associated with a unique key. The key is used to retrieve an individual item and is usually an integer or a string, but can be anything except an array.

Coding Standards

VBS Files

• A VBScript file name must consist of alphabets. • Name should preferably be in the format Project_Module_Function

Functions

• Must consist of alphabets. • Must start with ‘func’. • Name must stand for the functionality of the function. • If more than one word is used, the starting of every word should be in

capitals. • Numerical are not allowed in the names

21

Page 22: What QTP Features9.0 to 10.0

Quick Test Professional Eg: Public function funcOpenWindow (in window_name)

Constants and Variables

• Name of a constant must be in upper case letters with underscores in it. Eg: public const OR_PATH_DIR= c:\\mytests\\Action1;

• Name of a variable must be of lowercase letters and can contain underscores and digits. Eg: public my_variable_name=”This is my variable”;

Declare all the variables using DIM.

Object Repository

• Object repository file name must consist of alphabets and should be like project_Module_Function.tsr.

• If the name of an object or window is ambiguous, then it must be renamed in the format ObjectType_Label. Eg: Button_Done, Window_EngagementSummry, Checkbox_Overage, Radio_Awarded etc.

• If more than one word is used, the starting of every word should be in capitals.

Recovery Manager

• Name of a Recovery Manager file must be of alphabets and if necessary digits.

• The files must be of the format Project_Module_Function_in.qrs

SMART Identification

Smart Identification is nothing but an algorithm used by QTP when it is not able to recognize one of the object. A very generic example as per theQTP manual would be, A photograph of a 8 year old girl and boy and QTP records identification properties of that girl when she was 8, now when both are 10 years old then QTP would not be able to recognize the girl. But there is something that is still the same, that is there is only one girl in the photograph. So it kind of PI (Programmed intelligence) not AI.

When should i use SMART Identification?

Something that people don’t think about too much. But the thing is that you should disable SI while creating your test cases. So that you are able to recognize the objects that are dynamic or inconsistent in their properties. When the script has been created, the SI should be enabled,so that the script does not fail in case of small changes. But the developer of the script should always check for the test results to verify if the SI feature was used to identify a object or not. Sometimes SI needs to be disabled for particular objects in the OR, this is advisable when you use

SetTOProperty to change any of the TO properties of an object and especially ordinal identifiers like index, location and creation time

22

Page 23: What QTP Features9.0 to 10.0

Quick Test Professional Descriptive Programming

Descriptive programming is nothing but a technique using which operations can be performed on the AUT object which are not present in the OR.

What is a Recovery Scenario?

Recovery scenario gives you an option to take some action for recovering from a fatal error in the test. The error could range in from occasional to typical errors. Occasional error would be like “Out of paper” popup error while printing something and typical errors would be like”object is disabled” or “object not found”. A test case have more then one scenario associated with it and also have the priority or order in which it should be checked.

What does a Recovery Scenario consists of?

Trigger: Trigger is nothing but the cause for initiating the recovery scenario. It could be any popup window, any test error, particular stateof an object or any application error.

Action or Recovery Operation: Action defines what needs to be done if scenario has been triggered. It can consist of a mouse/keyboard event, close application, call arecovery function defined in library file or restart windows. You can have a series of all the specified actions.

Post-recovery operation: Basically defined what need to be done after the recovery action has been taken. It could be to repeat the step, moveto next step etc….

When to use a Recovery Scenario and when to us on error resume next?

Recovery scenarios are used when you cannot predict at what step the error can occur or when you know that error won’t occur in yourQTP script but could occur in the world outside QTP, again the example would be “out of paper”, as this error is caused by printer device driver. “Onerror resume next” should be used when you know if an error is expected and dont want to raise it, you may want to have different actions depending upon the error that occurred. Use err.number & err.description to get more details about the error.

How do we associate a library file with a test?

Library files are files containing normal VBScript code. The file can contain function, sub procedure, classes etc…. You can also use executefilefunction to include a file at run-time also. To associate a library file with your script go to Test->Settings… and add your library file to resourcestab.

23

Page 24: What QTP Features9.0 to 10.0

Quick Test Professional When to associate a library file with a test and when to use execute file?

When we associate a library file with the test, then all the functions within that library are available to all the actions present in the test. But when we use Executefile function to load a library file, then the function is available in the action that called executefile. By associated a library toa test we share variables across action (global variables basically), using association also makes it possible to execute code as soon as the script runs because while loading the script on startup QTP executes all the code on the global scope. We can use executefile in a library file associated with the test to load dynamic files and they will be available to all the actions in the test.

Test and Run-time Object What is the difference between Test Objects and Run Time Objects ?

Test objects are basic and generic objects that QTP recognize. Run time object means the actual object to which a test object maps.

Can i change properties of a test object

Yes. You can use SetTOProperty to change the test object properties. It is recommended that you switch off the Smart Identification for theobject on which you use SetTOProperty function.

Can i change properties of a run time object?

No (but Yes also). You can use GetROProperty(”outerText”) to get the outerText of a object but there is no function like SetROProperty tochange this property. But you can use WebElement().object.outerText=”Something” to change the property.

What is the difference between an Action and a function?

Action is a thing specific to QTP while functions are a generic thing which is a feature of VB Scripting. Action can have a object repository associated with it while a function can’t. A function is just lines of code with some/none parameters and a single return value while an action can have more than one output parameters.

Where to use function or action?

Well answer depends on the scenario. If you want to use the OR feature then you have to go for Action only. If the functionality is not about any automation script i.e. a function like getting a string between to specific characters, now this is something not specific to QTP and can be done onpure VB Script, so this should be done in a function and not an action. Code specific to QTP can also be put into an function using DP. Decision of using function/action depends on what any one would be comfortable using in a given situation.

What is checkpoint?

Checkpoint is basically a point in the test which validates for truthfulness of a specific things in the AUT. There are different types ofcheckpoints depending on the type of

24

Page 25: What QTP Features9.0 to 10.0

Quick Test Professional data that needs to be tested in the AUT. It can be text, image/bitmap, attributes, XML etc….

What’s the difference between a checkpoint and output value?

Checkpoint only checks for the specific attribute of an object in AUT while Output value can output those attributes value to a column in datatable.

How can i check if a checkpoint passes or not?

chk_PassFail = Browser(…).Page(…).WebEdit(…).Check (Checkpoint(”Check1″)) if chk_PassFail then MsgBox “Check Point passed” else MsgBox “Check Point failed” end if

My test fails due to checkpoint failing, Can i validate a checkpoint without my test failing due to checpoint failure?

Reporter.Filter = rfDisableAll ‘Disables all the reporting stuff chk_PassFail = Browser(…).Page(…).WebEdit(…).Check (Checkpoint(”Check1″)) Reporter.Filter = rfEnableAll ‘Enable all the reporting stuff if chk_PassFail then MsgBox “Check Point passed” else MsgBox “Check Point failed” end if

How can i import environment from a file on disk

• Environment.LoadFromFile “C:\Env.xml”

How can i check if a environment variable exist or not?

When we use Environment(”Param1″).value then QTP expects the environment variable to be already defined. But when we useEnvironment.value(”Param1″) then QTP will create a new internal environment variable if it does not exists already. So to be sure that variable existin the environment try using Environment(”Param1″).value.

How Does Run time data (Parameterization) is handled in QTP?

You can then enter test data into the Data Table, an integrated spreadsheet with the full functionality of Excel, to manipulate data sets and create multiple test iterations, without programming, to expand test case coverage. Data can be typed in or imported from databases, spreadsheets, or text files.

25

Page 26: What QTP Features9.0 to 10.0

Quick Test Professional What is keyword view and Expert view in QTP?

A) QuickTest’s Keyword Driven approach, test automation experts have full access to the underlying test and object propertyes, 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 QuickTest Professional automatically generates. Any changes made in the Expert View are automatically synchronized with the Keyword View.

Explain about the Test Fusion Report of QTP ?

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

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

What is QTP?

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, QuickTest Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications…

Explain QTP testing process?

The QuickTest testing process consists of 6 main phases:

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.

Recording a session on your application

As you navigate through your application, QuickTest graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.

26

Page 27: What QTP Features9.0 to 10.0

Quick Test Professional Enhancing your test

Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly.

NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process.

Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data.

Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.

Debugging your test

If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.

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.

Analyzing the test results

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

Reporting defects

As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.

How QTP recognizes Objects in AUT?

A) QuickTest stores the definitions for application objects in a file called the Object Repository. As you record your test, QuickTest will add an entry for each item you interact with. Each Object Repository entry will be identified by a logical name (determined automatically by QuickTest), and will contain a set of properties (type, name, etc) that uniquely identify each object. Each line in the QuickTest script will contain a reference to the object that you interacted with, a call to the appropriate method (set, click, check) and any parameters for that method (such as the value for a call to the set method). The references to objects in the script will all be identified by the logical name, rather than any physical, descriptive properties.

27

Page 28: What QTP Features9.0 to 10.0

Quick Test Professional What are the types of Object Repository’s in QTP?

A) Quick Test has two types of object repositories for storing object information: shared object repositories and action object repositories. You can choose which type of object repository you want to use as the default type for new tests, and you can change the default as necessary for each new test. The object repository per-action mode is the default setting. In this mode, Quick Test automatically creates an object repository file for each action in your test so that you can create and run tests without creating, choosing, or modifying object repository files. However, if you do modify values in an action object repository, your changes do not have any effect on other actions. Therefore, if the same test object exists in more than one action and you modify an object’s property values in one action, you may need to make the same change in every action (and any test) containing the object.

Explain the check points in QTP?

A checkpoint verifies that expected information is displayed in a Application while the test is running. You can add eight types of checkpoints to your test for standard web objects using QTP.

• A page checkpoint checks the characteristics of a Application • A text checkpoint checks that a text string is displayed in the appropriate

place on a Application. • An object checkpoint (Standard) checks the values of an object on a

Application. • An image checkpoint checks the values of an image on a Application. • A table checkpoint checks information within a table on a Application • An Accessiblity checkpoint checks the web page for Section 508 compliance. • An XML checkpoint checks the contents of individual XML data files or XML

documents that are part of your Web application. • A database checkpoint checks the contents of databases accessed by your

web site

In how many ways we can add check points to an application using QTP.

A) We can add checkpoints while recording the application or we can add after recording is completed using Active screen (Note : To perform the second one The Active screen must be enabled while recording).

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 Cass: WebEdit

If an application name is changes frequently i.e while recording it has name “Window1” and then while running its “Windows2” in this case how does QTP handles?

QTP handles those situations using “Regular Expressions”.

28

Page 29: What QTP Features9.0 to 10.0

Quick Test Professional What is Parameterize Tests?

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.

What is test object model in QTP?

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 whichyou 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 HTMLsource code:<INPUT TYPE=”submit” NAME=”Find” VALUE=”Find”>QuickTest identifies the object that you clicked as a WebButton test object.It creates a WebButton object with the name Find, and records the followingproperties 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

What is Object Spy in QTP?

A) Using the Object Spy, you can view the properties of any object in an openapplication. You use the Object Spy pointer to point to an object. The ObjectSpy displays the selected object’s hierarchy tree and its properties and valuesin the Properties tab of the Object Spy dialog box.

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

29

Page 30: What QTP Features9.0 to 10.0

Quick Test Professional 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 you rapplication handles small and large ticket orders, you can have QuickTestgenerate a random number and insert it in a number of tickets edit field.

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

Ans : You can use Test Batch Runner to run several tests in succession. The results for each test are stored in their default location. Using Test Batch Runner, you can set up a list of tests and save the list as an .mtb file, so that you can easily run the same batch of tests again, at another time. You can also choose to include or exclude a test in your batch list from running during a batch run

if i give some thousand tests to execute in 2 days what do u do?

Ans : Adhoc testing is done. It covers the least basic functionalities to verify that the system is working fine.

What does it mean when a check point is in red color? what do u do?

Ans : A red color indicates failure. Here we analyze the the cause for failure whether it is a Script Issue or Environment Issue or a Application issue.

How to Import data from a “.xls” file to Data table during Runtime.

Datatable.Import “…XLS file name…”

DataTable.ImportSheet(FileName, SheetSource, SheetDest) DataTable.ImportSheet “C:\name.xls” ,1 ,”name”

How to export data present in Datatable to an “.xls” file?

DataTable.Export “….xls file name…”

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

Ans: RunAction ActionName, [IterationMode, IterationRange, Parameters] Here the actions becomes reusable on making this call to any Action. Iteration Range 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.

30

Page 31: What QTP Features9.0 to 10.0

Quick Test Professional How to add a runtime parameter to a datasheet?

Ans: DataTable.LocalSheet

The following example uses the LocalSheet property to return the local sheet of the run-time Data Table in order to add a parameter (column) to it. MyParam=DataTable.LocalSheet.AddParameter(”Time”, “5:45″)

Object Repositories types, Which & when to use?

Deciding Which Object Repository Mode to Choose To choose the default object repository mode and the appropriate object repository mode for each test, you need to understand the differences between the two modes. In general, the object repository per-action mode is easiest to use when you are creating simple record and run tests, especially under the following conditions: You have only one, or very few, tests that correspond to a given application, interface, or set of objects. You do not expect to frequently modify test object properties. You generally create single-action tests. Conversely, the shared object repository mode is generally the preferred mode when: You have several tests that test elements of the same application, interface, or set of objects. You expect the object properties in your application to change from time to time and/or you regularly need to update or modify test object properties. You often work with multi-action tests and regularly use the Insert Copy of Action and Insert Call to Action options.

Can we Script any test case with out having Object repository? or Using Object Repository is a must?

Ans: No. U can script with out Object repository by knowing the Window Handlers, spying and recognizing the objects logical names and properties available.

How to handle Run-time errors

(a) On Error Resume Next : causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure. Using “Err” object msgbox “Error no: ” & “ ” & Err.Number & “ ” & Err.description & “ ” & Err.Source & Err.HelpContext

How to change the run-time value of a property for an object?

SetTOProperty changes the property values used to identify an object during the test run. Only properties that are included in the test object description can be set

How to retrieve the property of an object?

using “GetRoProperty”

31

Page 32: What QTP Features9.0 to 10.0

Quick Test Professional How to open any application during Scripting?

SystemUtil , object used to open and close applications and processes during a run session.

(a) A SystemUtil.Run statement is automatically added to your test when you run an application from the Start menu or the Run dialog box while recording a test

Ex: SystemUtil.Run “Notepad.exe”

SystemUtil.CloseDescendentProcesses ( Closes all the processes opened by QTP )

Types of properties that Quick Test learns while recording?

(a) Mandatory (b) Assistive . In addition to recording the mandatory and assistive properties specified in the Object Identification dialog box, QuickTest can also record a backup ordinal identifier for each test object. The ordinal identifier assigns the object a numerical value that indicates its order relative to other objects with an otherwise identical description (objects that have the same values for all properties specified in the mandatory and assistive property lists). This ordered value enables QuickTest to create a unique description when the mandatory and assistive properties are not sufficient to do so.

What is the extension of script and object repository files?

Ans : Object Repository : .tsr , Script : .mts, Excel : Default.xls

How to supress warnings from the “Test results page”?

Ans: From the Test results Viewer “View > Filters > Warnings”…must be “Unchecked”.

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 supresses only the result window, but a og will be created and can viewed manulaly which cannot be restricted from getting created.

Any limitation to XML Checkpoints?

Mercury has determined that 1.4MB is the maximum size of a XML file that QTP 6.5 can handle

How to make arguments optional in a function?

Ans : this is not possible as default VBS doesn’t support this. Instead you can pass a blank scring and have a default value if arguments r not required.

63. How to covert a String to an integer?

32

Page 33: What QTP Features9.0 to 10.0

Quick Test Professional Ans : CInt()—> a conversion function available.

Inserting a Call to Action is not importing all columns in Datatable of globalsheet. Why?

Ans: Inserting a call to action will only Import the columns of the Action called

33