Reading:  

Quick Test Professional - The starters Guide


Working with Virtual Objects in QTP

A virtual object is an object which is used to recognize by QTP as non-standard but is instructed explicitly by the tester to behave like a object.

Objects can be defined as virtual object (VO) of type button, link etc.

Example:

To automate a scenario in Microsoft Word, Example: Activate the already opened document of MS word and click Format Painter. The recorded code into QTP is:

Virtual Object Wizard Steps:

Step 1: Go to Tools select Virtual Objects select New Virtual Object and click next

 

Virtual Object Wizard Step 1

 

Step 2: We can choose any class depending on how the object in application is behaving like and click "Next" to find a classes list

 

Virtual Object Wizard Step 2 - QTP

 

Step 3: Click Mark Object and select the object and click Next

 

Virtual Object Wizard Step 3 - QTP

 

Step 4: To configure the selected object to be recognized with reference to its parent. Select the parent of the Virtual object and click next.

 

Virtual Object Wizard Step 4 - QTP

 

Step 5: Enter name and add it to a collection and click Finish

 

Virtual Object Wizard Step 4 - QTP

 

This ends the process for creation of a Virtual object. 

Virtual object Manager:

Virtual object Manager which manages the collections of Virtual objects. Here testers can add/delete the Virtual Objects from the Virtual object manager.

Go to Tools > Virtual Objects > Virtual Object Manager.

 

 

By clicking on “New” will go to the creation process again. Tester can delete a collection using the “Delete” button.

After the creation of the virtual object, repeat the recording process on AUT for the same object. The code is:

Window("Microsoft Word").WinObject("NetUIHWND").VirtualButton("button").Click 

Virtual Object Limitations:

  • QTP doesn't support virtual objects for low-level/analog recording.
  • Virtual Object is NOT controlled by Object Repository.
  • Virtual Objects doesn’t support Object Spy and Checkpoints.
  • The test execution will be failed if the screen resolution changes as the co-ordinates change.
  • The Application Window must be of same screen size to capture Virtual objects properly.

Description

In this tutorial, we will get to know Quick test professional. At the time of writting QTP is at version 12.2. This tutorial is subdivided into multiple parts as shown below

  • What is QTP
  • Automating tests
  • Environment
  • Recording and Playback
  • Object Repository
  • Actions
  • Data Table
  • Checkpoints in QTP
  • Synchronization
  • Smart Identification
  • Debugging and Error handling
  • Recovery Scenarios
  • Environment Variables
  • Library Files
  • Test Results
  • GUI Objects
  • Virtual Objects
  • Accessing Databases
  • Working with XML
  • Descriptive Programming
  • Automation Object Model
  • A work on Frameworks

Leave your feedback for us, Feedback help us improve our tutorials.

 



Prerequisites

Some knowledge on Windows OS and VB Script is recommended

Audience

Students who wish to learn QTP

Learning Objectives

Learn QTP

Author: Subject Coach
Added on: 16th Mar 2015

You must be logged in as Student to ask a Question.

None just yet!