Automation Testing, Manual Testing, QTP/UFT 11 , QC/ALM 11 ,SAP TAO, Unix, Selenium, Oracle SQL, Shell Scripting and For Online Trinings to contact me : Cell:+91-8897972059 , Email Id : quicktestprotech@gmail.com

Wednesday, November 3, 2010

Descriptive Programming for Virtual Objects

When the application is having objects that are unable to identify by QTP then we will be using the concept virtual objects. We can create virtual objects using Virtual Object Manager. That created virtual objects will be stored as a VOT file in <QuickTest installation folder>\ dat \ VoTemplate. If we want to use those virtual objects in another machine or If we want to use the scripts which are using virtual objects in different machines, then We must copy the .VOT files to the machines where you want to run. Here it will become a maintenance problem. If we forgot / neglect to do that then the scripts will not work.
Descriptive Programming for Virtual Objects is the best solution to overcome this problem. In this you need not create any objects using virtual object manager. The Virtual Objects uses the properties x, y, width and height. All you need to do is you have to mention these properties & property values in script.
For example, in the below script I have virtually created a button under a page. If i execute this automatically that particular area will be highlighted. For this I haven’t created any virtual object using Virtual Object Manager.
Browser("name:=Google").Page("title:=Google").VirtualButton("x:=698","y:=128","height:=18","width:=41","name:=hi").highlight
So now I can run this script on any machine without considering VOT files. You can even store the object information in description object and use that description object in script.


Set oVirtualDescription=Description.Create
oVirtualDescription("x").value=698
oVirtualDescription("y").value=128
oVirtualDescription("height").value=18
oVirtualDescription("width").value=41
Browser("name:=Google").Page("title:=Google").VirtualButton(oVirtualDescription).highlight


There is no facility to create VirtualEdit. We can do descriptive programming for the classes which can be created using Virtual Object Manager. The thumb rule for Virtual Objects Descriptive Programming is we have to use the properties that QuickTest learns for the virtual objects in to object repository. 

For Virtual Lists you need to use one more property "rows:=number" and use "rows:=number", "columns:=number" for virtual table. 

0 comments:

Post a Comment

Loading...