Virtual Objects
2 posters
Re: Virtual Objects
As far as I understand, Yes if the screen resolution changes, they should not work as the co-ordinates change when you change the resolution.
Screen resolution
Hi Sir,
Does it vary if the screen resolution change, like the browser is maximized or minimized or altering with the screen?
Does it vary if the screen resolution change, like the browser is maximized or minimized or altering with the screen?
sriharish2- Posts : 8
Join date : 2012-10-31
Re: Virtual Objects
Yes, suggestable when all these methods do not work. But few opt to use them even the childobjects or other methods work, may be due to lack of knowledge or just for the sake of using VO. Its upto the individual how he wants to automate a test.
I've mentioned this in the earlier comment.
I've mentioned this in the earlier comment.
Thank you sir
Thank You sir!!
Is these applicable when an object is not identified in Child objects? Is it Like child objects?
Is these applicable when an object is not identified in Child objects? Is it Like child objects?
sriharish2- Posts : 8
Join date : 2012-10-31
Re: Virtual Objects
When the objects in an application are not identified by normal methods like: Object spy or descriptive methods like - childobjects, object (to acces native properties) etc using QTP, or the complete window/ screen is recognized as a single object, rather you spy on an internal object of the window. In these cases you'll be using the concept of virtual objects.
We can create virtual objects using Virtual Object Manager in QTP>Tools>Virtual Object Manager (following the Wizard instructions).
The created virtual objects will be stored as a VOT file in the following folder:
QuickTest installation folder\dat\VoTemplate
If you want to use the created virtual objects in other machine(s) or If you want to use the scripts which are using virtual objects in other machines, then you must copy the ".VOT" file(s) to the machines on which you want to run the scripts using these virtual onjects.
This enables maintenance activity as you need to move your ".VOT" files where ever you run the scripts using them. If you forget/miss to do the copy, then the scripts will not fail.
The best solution to overcome this problem is Descriptive Programming of Virtual Objects.
In this you need not create any objects using virtual object manager.
The Virtual Objects use the properties co-ordinates - x, y, width and height.
All you need to do is describe these properties & values in the line of code.
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("title:=XYZ").Page("title:=XYZ").VirtualButton("name:=Submit","x:=100","y:=50","width:=50","height:=20").highlight
You can run the above line of code on any machine without creating a virtual object through virtual object manager or care about moving the ".VOT" files.
You may use description object for the virtual object as well:
Set VirtualDescObj = Description.Create()
VirtualDescObj("name").value="Submit"
VirtualDescObj("x").value=100
VirtualDescObj("y").value=50
VirtualDescObj("height").value=20
VirtualDescObj("width").value=41
Browser("title:=XYZ").Page("title:=XYZ").VirtualButton(VirtualDescObj).highlight
We can create virtual objects using Virtual Object Manager in QTP>Tools>Virtual Object Manager (following the Wizard instructions).
The created virtual objects will be stored as a VOT file in the following folder:
QuickTest installation folder\dat\VoTemplate
If you want to use the created virtual objects in other machine(s) or If you want to use the scripts which are using virtual objects in other machines, then you must copy the ".VOT" file(s) to the machines on which you want to run the scripts using these virtual onjects.
This enables maintenance activity as you need to move your ".VOT" files where ever you run the scripts using them. If you forget/miss to do the copy, then the scripts will not fail.
The best solution to overcome this problem is Descriptive Programming of Virtual Objects.
In this you need not create any objects using virtual object manager.
The Virtual Objects use the properties co-ordinates - x, y, width and height.
All you need to do is describe these properties & values in the line of code.
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("title:=XYZ").Page("title:=XYZ").VirtualButton("name:=Submit","x:=100","y:=50","width:=50","height:=20").highlight
You can run the above line of code on any machine without creating a virtual object through virtual object manager or care about moving the ".VOT" files.
You may use description object for the virtual object as well:
Set VirtualDescObj = Description.Create()
VirtualDescObj("name").value="Submit"
VirtualDescObj("x").value=100
VirtualDescObj("y").value=50
VirtualDescObj("height").value=20
VirtualDescObj("width").value=41
Browser("title:=XYZ").Page("title:=XYZ").VirtualButton(VirtualDescObj).highlight
Virtual Objects
Hi Sir,
Where do we use Virtual Objects? How should we use them?
Where do we use Virtual Objects? How should we use them?
sriharish2- Posts : 8
Join date : 2012-10-31
Permissions in this forum:
You cannot reply to topics in this forum
Thu Jun 19, 2014 11:31 am by thomasdfg
» How to identify the object when it is dynamically changing behavior
Wed Jun 18, 2014 6:37 pm by thomasdfg
» Patches for QTP 10, 11, 11.5
Wed Jun 18, 2014 6:04 pm by thomasdfg
» Retrieving data from Txt file into datatable
Wed Jun 18, 2014 5:32 pm by thomasdfg
» VB Script to count number of links in a web page.
Wed Jun 18, 2014 4:51 pm by thomasdfg
» Customized HTML reports in QTP
Wed Jun 18, 2014 4:42 pm by thomasdfg
» how to print values into a field of a web page, from a data table in qtp?
Wed Jun 18, 2014 4:37 pm by thomasdfg
» How to delete cookies using QTP?
Wed Jun 18, 2014 4:30 pm by thomasdfg
» When UFT Does Not Identify an Object
Wed Jun 18, 2014 4:23 pm by thomasdfg