Pages

Custom Search

Test Object Model

Test Object Model

Test Object Model

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 identification properties that QuickTest can learn about the object, a sub-set of these properties that can uniquely identify objects of that class, and a set of relevant operations that QuickTest can perform on the object.

A test object is an object that QuickTest creates in the test to represent the actual object in your application. QuickTest stores information on 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 application on which methods are performed during the run session.

When QuickTest learns an object in our application, it adds the corresponding test object to an object repository, which is a storehouse for objects. we can add test objects to an object repository in several ways.

When you add an object to an object repository, QuickTest:

•    Identifies the QuickTest test object class that represents the learned object and creates the appropriate test object.
•    Reads the current value of the object's properties in your application and stores the list of identification properties and values with the test object.
•    Chooses a unique name for the test object, generally using the value of one of its prominent properties.

Test Object and Native Properties and Operations

The identification property set for each test object is created and maintained by QuickTest. The native property set for each run-time object is created and maintained by the object creator (for example, Microsoft for Microsoft Internet Explorer objects, Netscape for Netscape Browser objects, the product developer for ActiveX objects, and so on).
Similarly, a test object operation is a method or property that QuickTest recognizes as applicable to a particular test object class. For example, the Click method is applicable to a WebButton test object. As you add steps to your test, you specify which operation to perform on each test object. If you record steps, QuickTest records the relevant operation as it is performed on an object.
During a run session, QuickTest performs the specified test object operation on the run-time object. Native operations are the methods of the object in your application as defined by the object creator.
Property values of objects in your application may change dynamically each time your application opens, or based on certain conditions. You may need to modify the identification property values to match the native property values. You can modify identification properties manually while designing your test, or use SetTOProperty statements during a run session. You can also use regular expressions to identify property values based on conditions or patterns you define, or you can parameterize property values with Data Table parameters so that a different value is used during each iteration of the test. For more information on modifying object properties, see Managing Test Objects in Object Repositories. For more information on parameterization, see Parameterizing Values. For more information on regular expressions, see 

Understanding and Using Regular Expressions.

You can view or modify the identification property values that are stored with your test in the Object Properties or Object Repository dialog box. For more information, see Specifying or Modifying Property Values.

We can view the current identification property values of any object on your desktop using the Properties tab of the Object Spy. For more information, see Viewing Object Properties and Operations Using the Object Spy.
 
We can view the syntax of the test object operations as well as the native operations of any object on your desktop using the Operations tab of the Object Spy. For more information, see Viewing Object Properties and Operations Using the Object Spy.
 
We can retrieve or modify property values of the test object during the run session by adding GetTOProperty and SetTOProperty statements in the Keyword View or Expert View. We can retrieve property values from the run-time object during the run session by adding GetROProperty statements. For more information, see Retrieving and Setting Identification Property Values.
 
If the available test object operations and identification properties for a test object do not provide the functionality you need, you can access the internal operations and properties of the run-time object using the Object property. You can also use the attribute object property to identify Web objects in your application according to user-defined properties. For information, see Accessing Native Properties and Operations.

Understanding Object Repository Types

Objects can be stored in two types of object repositories—a shared object repository and a local object repository. A shared object repository stores objects in a file that can be accessed by multiple tests (in read-only mode). A local object repository stores objects in a file that is associated with one specific action, so that only that action can access the stored objects.
When you plan and create tests, you must consider how you want to store the objects in your tests. You can store the objects for each action in its corresponding local object repository, or you can store the objects in your tests in one or more shared object repositories. By storing objects in shared object repositories and associating these repositories with your actions, you enable multiple actions to use the objects. For each action, you can use a combination of objects from your local and shared object repositories, according to your needs. You can also transfer local objects to a shared object repository, if required. This reduces maintenance and enhances the reusability of your tests because it enables you to maintain the objects in a single, shared location instead of multiple locations. For more information, see Deciding Whether to Use Local or Shared Object Repositories.
If you are new to using QuickTest, you may want to use local object repositories. In this way, you can record and run tests without creating, choosing, or modifying shared object repositories because all objects are automatically saved in a local object repository that can be accessed by its corresponding action. If you modify an object in the local object repository, your changes do not have any effect on any other action or any other test (except tests that call the action, as described in Inserting Calls to Existing Actions).
If you are familiar with testing, it is probably most efficient to save objects in a shared object repository. In this way, you can use the same shared object repository for multiple actions—if the actions include the same objects. Object information that applies to many actions is kept in one central location. When the objects in your application change, you can update them in one location for all the actions that use this shared object repository.
If an object with the same name is located in both the local object repository and in a shared object repository associated with the same action, the action uses the local object definition. If an object with the same name is located in more than one shared object repository associated with the same action, the object definition is used from the first occurrence of the object, according to the order in which the shared object repositories are associated with the action. For more information on associating shared object repositories, see Associating Object Repositories with Actions.
Local objects are saved locally with the action, and can be accessed only from that action. When using a shared object repository, you can use the same object repository for multiple actions. You can also use multiple object repositories for each action.
 
When you open and work with an existing test, it always uses the object repositories that are specified in the Associated Repositories tab of the Action Properties dialog box or in the Associate Repositories dialog box. Shared object repositories are read-only when accessed from tests; you edit them using the Object Repository Manager.

Keyword Driven Methodology

Keyword Driven Methodology

Keyword-Driven Methodology

By creating our tests with a keyword-driven methodology in mind, our tests become more modular, focusing on the operations to test using both QuickTest built-in keywords and your own user-defined keywords.

 
Additionally, because it is possible to add objects to the object repository before they exist in an application, it is possible to begin preparing our automated keyword-driven tests even before a software build containing the new objects is available. 

 
Setting up Object Repositories
 

In this step, we build one or more object repositories and ensure that all objects have clear names that follow any predetermined naming conventions defined by our organization. 
 
We can create object repositories using QuickTest functionality to recognize and learn the objects in your application, or we can manually define objects.
By creating and populating shared object repositories that can be associated with multiple actions, we can use the same object repository in multiple tests.
 

Add (learn) objects from our application.

We instruct QuickTest to learn the objects in our application according to filters that we define.
 

Ensure that objects in the object repository have names that are easy for application testers to recognize and that follow any established object naming guidelines.
 

This helps make both test creation and maintenance easier over time.
 
Configuring QuickTest According to our Testing Needs
 

After we set up the test automation infrastructure, we need to configure QuickTest to use this infrastructure:
 

Define your global testing preferences.
 

We need to specify configuration settings that affect how we create and run tests in general—these settings are not test-specific.
 

Building our Tests 
 
We can create tests that are as simple or complex as needed. In general, it is best to create tests and actions that check just one or a few simple functions or complete a transaction rather than creating long tests and actions that perform several complex tasks or that perform many tasks.
 

We may perform the following tasks when creating tests and test steps:
 

Create new tests, if needed. To do so, select File > New > Test.
 

Create the required actions.
 

Associate our object repositories with the relevant actions
 This enables us to insert steps that perform operations on those objects.
 

Associate our function libraries with the relevant tests. This enables us to use our special keywords in any of the associated tests.

Recording Tests and Running Tests

Recording Tests

Recording and Running


In QTP, there are 3 Recording modes available for Creating Tests.

1. Normal Recording

It records User Mouse and Keyboard operations on AUT with respect to objects, but unable to record continuous mouse operations like Digital Signatures, graphs, paints etc.

During recording QTP generates VbScript statements in Test Pane, Simultaneously it stores objects information into object repository.

Navigation: Automation>Record
Or
Select Record option on automation toolbar
Or
Use short cut key (F3)

Steps for preparing a Test (through Recording):

1.Put AUT in base state
2.Select Record Option
3.It shows Record and Run Settings, Select type of Environment (Windows or Web)
4.Select Record Option

(It shows two Options :
1.Record and Run Test on any open window based applications
2.Record and Run only on)

If we select first option it records on any opened application on Desktop.
If we select Second option, it asks for the path of the AUT, After Providing the path it records only on that particular application.)

5.Click OK
6.Perform actions on AUT
7.Stop recording.
8.Save the Test

2. Analog Recording:

It records the exact mouse and keyboard operations. We can use this mode for recording continuous mouse operations. It is not useful for recording normal operations why because it does not generate steps for each operation, generates total user actions in a Track File. The Track file is not editable.

Navigation:

1.Keep tool under recording mode
2.Automation >Analog Recording
OR
Use Short cut Key (Shift + ALT+F3)

Steps for preparing a TEST (through Analog Recording):

1.Launch AUT (or we can launch AUT through QTP)
2.Select Record option
3.Automation>Analog Recording
4.Analog Recording Settings Dialog box opens

(In this Dialog box two options available.

1.Record relative to the screen
2.Record relative to the following window)

(If we select first option QTP records User operations with respect to Desktop co-ordinates.
If we select Second option, we have to show the window (AUT), after showing the Window it records with respect to that window co-ordinates.)

5.Select any one option in the dialog box and click Start Analog record.
6.It records User actions
7.Stop Recording


3. Low Level Recording

It records some operations on Non-supported environments apart from Normal operations.

This mode records at the object level and records all run time objects as window or winobject Test objects.

Use Low Level Recording for recording in an environment not recognized by QTP.

Navigation:
1.Keep tool under recording mode
2.Automation >Low Level Recording

Steps for preparing a TEST (through Low Level Recording):

1)Launch AUT (or we can launch AUT through QTP)
2)Select Record option
3)Automation> Low Level Recording
4)Perform options on AUT
5)Stop Recording
6)Save the Test

7 Stages of QTP Testing Process

QTP Testing Process

7 Stages of QTP Testing Process

1) Planning

o Analyzing the AUT
o Automation Test Plan Generation
o Automation Framework Implementation
o Generating/Selecting Test cases for Automation
o Collecting Test Data
o QTP Tool Settings Configuration

2) Generating Tests

o Recording
o Keyword driven methodology
o Descriptive Programming

3) Enhancing Tests

o Inserting Checkpoints
o Inserting Output values
o Adding Comments
o Synchronization
o Parameterization
o Inserting Flow Control Statements
o Calling User defined functions and/or Reusable Actions
o Generating Steps though Step Generator
o Inserting Transaction Points
o Regular Expressions

4) Debugging Tests

o Debug Commands & Break Points
o Step by step execution
o Watching Variables
o Changing values of variables

5) Running Tests

o Normal Execution
o Batch Execution
o Through AOM Scripting
o Tests Running through framework
o Scheduled Execution

6) Analyzing Results

o QTP Result window
o Defining our own Results
o Exporting Results
o Deleting Results

7) Reporting Defects

o Manual Defect Reporting
o Tool based Defect Reporting
o Working with Quality Center

QTP Commands - All Commands

QTP Commands

QTP Commands are available in 3 ways.

1.Menu options
2.Tool Bar options
3.Short cut keys (for Some important operations only)

File menu: Through file menu user can create, save tests, open existing tests, export tests in zip format.

Command
Function
New > Test
Creates a new test.
New > Business Component
Creates a new business component.
New > Scripted Component
Creates a new scripted component.
New > Application Area
Creates a new application area.
New > Function Library
Creates a new function library.
Open > Test
Opens an existing test.
Open > Business/Scripted Component
Opens an existing business or scripted component.
Open > Application Area
Opens an existing application area.
Open > Function Library
Opens an existing function library.
Close
Closes the active function library.
Close All Function Libraries
Closes all open function libraries.
Quality Center Connection
Opens the Quality Center Connection dialog box, enabling you to connect to a Quality Center project.
Quality Center Version Control
Provides a sub-menu of options for managing versions of QuickTest assets in Quality Center. The sub-menu is available only when you are connected to version-control enabled Quality Center project.
Save
Saves the active document.
Save As
Opens the relevant Save dialog box so you can save the open document.
Save Test with Resources
Saves a standalone copy of the current test together with its resource files.
Save All
Saves all open documents.
Enable Editing
Makes read-only function libraries editable.
Export Test to Zip File
Creates a zip file of the active document.
Import Test from Zip File
Imports a document from a zip file.
Convert to Scripted Component
Converts a business component to a scripted component.
Print
Prints the active document.
Print Preview
Displays the Keyword View as it will look when printed and enables you to modify the page setup.
Settings
Opens the Settings dialog box, enabling you to define settings for the open document. (Not relevant for function libraries)
Process Guidance Management
Opens the Process Guidance Management dialog box, enabling you to manage the list of processes that are available in QuickTest.
Associate Library '<Function Library Name>' with '<Document Name>'
Associates the active function library with the open document. (Available only from function libraries)
Recent Files
Lists the recently viewed files.
Exit
Closes the QuickTest session.

Edit Menu: It provides editing options and renaming, deleting and splitting actions.


Command
Function
Undo
Reverses the last command or deletes the last entry you typed.
Redo
Reverses the most recent operation of the Undo command.
Cut
Removes the selection from your document.
Copy
Copies the selection from your document.
Paste
Pastes the selection to your document.
Delete
Deletes the selection from your document.
Copy Documentation to Clipboard
Copies the content of the Documentation column of the Keyword View, enabling you to paste it in an external application.
Action > Split Action
Separates an action into two sibling actions or into parent-child nested actions.
Action > Rename Action
Changes the name of an action.
Action > Delete Action
Enables you to remove the selected call to the action, or delete the action and its calls from the active test.
Action > Action Properties
Enables you to specify options, parameters, and associated object repositories for a stored action.
Action > Action Call Properties
Enables you to specify the number of run iterations according to the number of rows in the Data Table, and to define the values of input parameters and the storage location of output parameters.
Step Properties > Comment Properties
Opens the Comment Properties dialog box for a comment step. Available only when the selected step is a comment.
Step Properties > Object Properties
Opens the Object Properties dialog box for a selected object. Available only when the selected step contains a test object.
Step Properties > Checkpoint Properties
Opens the relevant Checkpoint Properties dialog box for a selected object. Available only when the selected step is a checkpoint step.
Step Properties > Output Value Properties
Opens the relevant Output Value Properties dialog box for a selected object. Available only when the selected step is an output value step.
Step Properties > Report Properties
Displays the Report Properties dialog box for a report step. Available only when the selected step is a Reporter.ReportEvent step.
Find
Searches for a specified string.
Replace
Searches and replaces a specified string.
Go To
Moves the cursor to a particular line in the test.
Bookmarks
Creates bookmarks in your script for easy navigation.
Advanced > Comment Block
Comments out the current row, or selected rows.
Advanced > Uncomment Block
Removes the comment formatting from the current or selected rows.
Advanced > Indent
Indents the step according to the tab spacing defined in the Editor Options dialog box.
Advanced > Outdent
Outdents the step (reduces the indentation) according to the tab spacing defined in the Editor Options dialog box.
Advanced > Go to Function Definition
Navigates to the definition of the selected function.
Advanced > Complete Word
Completes the word when you type the beginning of a VBScript method or object.
Advanced > Argument Info
Displays the syntax of a method.
Advanced > Apply "With" to Script
Generates With statements for the action displayed in the Expert View, and enables IntelliSense within With statements.
Advanced > Remove "With" Statements
Converts any With statements in the action displayed in the Expert View to regular (single-line) VBScript statements.
Optional Step
Inserts an optional step (a step that is not required to successfully complete a run session).

View menu: Through this menu we can launch and close, active screen, Data Table, Debug viewer, information, missing resources etc.

Insert Menu: Through this menu user can inserting check points, out put values, synchronizing points.

In this menu step generator available, using this user can generate recordable and non-recordable scripts.

Through insert menu user can insert VB Script conditional and loop statements and transaction points (Start and End).

Through insert menu user can create new actions, call existing actions and copy existing actions.

Automation Menu:
This menu provides Record, Run options and Run setting options
Through this menu we can start normal recording, analog recording and Low level recording.

Through this menu we can stop recoding, running and also we run tests.

Command
Function
Record
Starts a recording session.
Run
Starts a run session from the beginning or from the line at which the session was paused.
Stop
Stops the recording or run session.
Run Current Action
Runs only the active action.
Run from Step
Starts a run session from the selected step.
Maintenance Run Mode
Starts a run session during which the Maintenance Run Mode wizard opens for steps that failed because an object was not found in the application (if applicable).
Update Run Mode
Starts a run session to update test object descriptions and other options (if applicable).
Analog Recording
Starts recording in Analog Recording mode.
Low Level Recording
Starts recording in Low Level Recording mode.
Record and Run Settings
Opens the Record and Run Settings dialog box, enabling you to define browser preferences for recording and running your test.
Process Guidance List
Lists the processes that are available for the current document type and for the currently loaded QuickTest add-ins, enabling you to open them.
Results
Enables you to view results for a test run session.

Resources Menu:

This menu provides object repository and recovery scenarios options.
Through this menu we can create /modify/delete objects information and we can associate repositories.
Through this menu we can create, modify and delete recovery scenarios.

Command
Function
Object Repository
Opens the Object Repository window, which displays a tree containing all objects in the current test or component.
Object Repository Manager
Opens the Object Repository Manager dialog box, enabling you to open and modify multiple shared object repositories.
Associate Repositories
Opens the Associate Repositories dialog box, enabling you to manage the object repository associations for the test.
Map Repository Parameters
Opens the Map Repository Parameters dialog box, enabling you to map repository parameters, as needed.
Recovery Scenario Manager
Opens the Recovery Scenario Manager dialog box.
Associated Function Libraries
Lists the function libraries associated with the active document, enabling you to open them.

Debug Menu:
This menu provides debug commands for step by step execution.
Through this menu we can insert/remove/break points.

Tools Menu:
This menu provides Tools settings option, view options and object identification configuration.
Through this menu we can set tool options as well as test pane view options.
In this menu object spy option available, through this we can get object's information.(Properties and values)
In this menu Virtual object option available; through this option we can create virtual objects.

Command
Function
Options
Opens the Options dialog box, enabling you to modify global testing options.
View Options
Opens the Editor Options dialog box, enabling you to customize how tests and function libraries are displayed in the Expert View and Function Library windows.
Check Syntax
Checks the syntax of the active document.
Object Identification
Opens the Object Identification dialog box, enabling you to specify how QuickTest identifies a particular test object.
Object Spy
Opens the Object Spy dialog box, enabling you to view the native properties and operations of any object in an open application, as well as the test object hierarchy, identification properties, and operations of the test object that QuickTest uses to represent that object.
Web Event Recording Configuration
Opens the Web Event Recording Configuration dialog box, enabling you to specify a recording configuration level. (Relevant for tests only)
Data Driver
Opens the Data Driver dialog box, which displays the default Constants list for the action. (Relevant for tests only)
Change Active Screen
Replaces the previously recorded Active Screen with the selected Active Screen. (Relevant for tests only)
Virtual Objects > New Virtual Object
Opens the Virtual Object Wizard, enabling you to teach QuickTest to recognize an area of your application as a standard test object.
Virtual Objects > Virtual Object Manager
Opens the Virtual object Manager, enabling you to manage all of the virtual object collections defined on your computer.
Customize
Opens the Customize dialog box, which enables you to customize toolbars and menus, and create new menus.

Window Menu:
This menu provides QTP tool window style settings.

Help Menu:
This menu provides QTP help as well as VB Script help.
Through this menu we can contact technical support people and we can send feedback.
Through this menu we can check for updates and download or install directly.