http://quicktesthp.blogspot.com

QTP VBScript new series + Interview Question Bank on QTP for enrichment of Knowledge in QTP

This Site has been brought to you by HP Certified Expert of QTP.

Exciting new articles for October:

1) QTP Tip:Deselect all Radio Buttons

2) HP QTP Crypt Object

3)Adding Hyperlinks in Excel Spreadsheet

Best of Luck Friends ! ! !

Expert QTP
expert.qtp@gmail.com

All Articles are Copyright Protected. These are Free for Reading & Personal Use. Reproduction in Any Form without the Permission is Illegal & Strictly Prohibited.

Copyright © 2009 ExpertQTP

Google Search

Friday, June 6, 2008

AOM : Automation Object Model

Automating QuickTest Operations

Just as you use QuickTest to automate the testing of your applications, you can use the QuickTest Professional automation object model to automate your QuickTest operations. Using the objects, methods, and properties exposed by the QuickTest automation object model, you can write programs that configure QuickTest options and run tests or components instead of performing these operations manually using the QuickTest interface.

Automation programs are especially useful for performing the same tasks multiple times or on multiple tests or components, or quickly configuring QuickTest according to your needs for a particular environment or application.

About Automating QuickTest Operations

You can use the QuickTest Professional automation object model to write programs that automate your QuickTest operations. The QuickTest automation object model provides objects, methods, and properties that enable you to control QuickTest from another application.

What is Automation?

Automation is a Microsoft technology that makes it possible to access software objects inside one application from other applications. These objects can be easily created and manipulated using a scripting or programming language such as VBScript or VC++. Automation enables you to control the functionality of an application programmatically.

An object model is a structural representation of software objects (classes) that comprise the implementation of a system or application. An object model defines a set of classes and interfaces, together with their properties, methods and events, and their relationships.

What is the QuickTest Automation Object Model?

Essentially all configuration and run functionality provided via the QuickTest interface is in some way represented in the QuickTest automation object model via objects, methods, and properties. Although a one-on-one comparison cannot always be made, most dialog boxes in QuickTest have a corresponding automation object, most options in dialog boxes can be set and/or retrieved using the corresponding object property, and most menu commands and other operations have corresponding automation methods.

You can use the objects, methods, and properties exposed by the QuickTest automation object model, along with standard programming elements such as loops and conditional statements to design your program.

Automation programs are especially useful for performing the same tasks multiple times or on multiple tests or components, or quickly configuring QuickTest according to your needs for a particular environment or application.

For example, you can create and run an automation program from Microsoft Visual Basic that loads the required add-ins for a test or component, starts QuickTest in visible mode, opens the test or component, configures settings that correspond to those in the Options, Test or Business Component Settings, and Record and Run Settings dialog boxes, runs the test or component, and saves the test or component.

You can then add a simple loop to your program so that your single program can perform the operations described above for multiple tests or components.

You can also create an initialization program that opens QuickTest with specific configuration settings. You can then instruct all of your testers to open QuickTest using this automation program to ensure that all of your testers are always working with the same configuration.

Deciding When to Use QuickTest Automation Programs

Like the tests or components you design using QuickTest, creating a useful QuickTest automation program requires planning, design time, and testing. You must always weigh the initial investment with the time and human-resource savings you gain from automating potentially long or tedious tasks.

Any QuickTest operation that you must perform many times in a row or must perform on a regular basis is a good candidate for a QuickTest automation program.

The following are just a few examples of useful QuickTest automation programs:

  • Initialization programs—You can write a program that automatically starts QuickTest and configures the options and the settings required for recording on a specific environment.
  • Maintaining your tests or components—You can write a program that iterates over your collection of tests and components to accomplish a certain goal. For example:
    • Updating values—opening each test or component with the proper add-ins, running it in update run mode against an updated application, and saving it in order to update the values in all of your tests and components to match the updated values in your application.
    • Applying new options to existing tests or components—When you upgrade to a new version of QuickTest, you may find that the new version offers certain options that you want to apply to your existing tests and components. You can write a program that opens each existing test and component, sets values for the new options, then saves and closes it.
  • Calling QuickTest from other applications—You can design your own applications with options or controls that run QuickTest automation programs. For example, you could create a Web form or simple Windows interface from which a product manager could schedule QuickTest runs, even if the manager is not familiar with QuickTest.

No comments:

 
Copyright © 2009 ExpertQTP