Pages

Friday, August 27, 2010

Virtual Objects

What is Virtual Object?
A virtual object is defined by user in Quick Test to recognize any area of your application as an object. Virtual objects enable you to record and run tests on objects that are not normally recognized by Quickest.
What is virtual Object Collection?
A virtual object collection is a group of virtual objects that is stored in the Virtual Object Manager under a descriptive name.
How to disable virtual Objects while recording?
Go to Tools-->Options--> General Tab--> Disable Recognition of virtual objects while recording
Check and uncheck this option to disable or enable virtual objects while recording.
What is the storage location of Virtual Objects?
If you create any virtual objects automatically those objects will be stored in
<Quickest installation folder>\ dat \ VoTemplate
What is extension of virtual objects file?
.VOT
What are the limitations and drawbacks of Virtual Objects?
· Quickest does not support virtual objects for analog or low-level recording.
· Not possible to apply a checkpoint on a virtual object
· Only by recording we can add virtual objects
· Not possible to add virtual objects using Object Repository
· Not possible to spy on a virtual object using object spy
· Virtual Objects doesn’t support all objects and methods.
· May not run perfectly on different screen resolutions if a test using Virtual Objects.
· Virtual object uses the properties Name, Height, Width, X, Y which the properties are having maximum possibilities for frequent change.
Creating a virtual object
Open a new test click on Tools-->virtual object-->new virtual object the following window opens
clip_image002
Click on Next-->select “button” from the combobox-->click on Next -->he below screen appears
clip_image004
clip_image005clip_image005[1]Click on the mark object the cursor changes as the symbol -- -- just drag and select on the button on which u want create the virtual object like below .i have created on “OK” button of “Login”
clip_image007clip_image009
The screen captures width and height of “OK” button à click on next the below screen appears
clip_image011
Select “Entire parent hierarchy -->and click on next-->the below screen appears
clip_image013
We can see the name as “button” on which we created the virtual object and it shows collection name as “VoCollection6”.if you want to create one more virtual object the select the radio button “Yes” if not then select “No”àclick on “Finish”
NOW record for “login” the following line of code will be generated
SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"
1.Dialog("Login").WinEdit("Agent Name:").Set "agentjjj"
2.Dialog("Login").WinEdit("Password:").SetSecure "4c69845dab4535b260da2cea98526c2960751cb9"
3.Dialog("Login").WinButton("OK").VirtualButton("button").Click
4.Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
We can see the differnece in the line of script generated for “OK” button before creating virtual objects and after creating virtual object
BEFORE:- Dialog("Login").WinButton("OK").Click
AFTER :-Dialog("Login").WinButton("OK").VirtualButton("button").Click
In Virtual Object Manager we will find all the collection of virtual objects.
go to tools—>virtual object—>virtual object  manager
image