Facebook

For any corporate training requirements Please mail To sudhakar@qtpsudhakar.com
New Schedule in MindQ Systems, Madhapur By SUDHAKAR
Course Name Date Time Duration Type Branch
Selenium+Appium 16th October 2017 7.30 AM - 9.00 AM IST 45 Days ClassRoom + Online Mind Q Madhapur
Selenium+Appium 30th October 2017 9.30 AM - 11.00 AM IST 45 Days ClassRoom + Online Mind Q Madhapur

A book "Cracking the QTP interview" authored by Sudhakar.Read More. Buy From FlipKart

Thursday, April 8, 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.


Click here to see more about Virtual Objects


Note: Before executing this function the window/Browser of the object should be the first window of the desktop. An individual step may not perfectly execute but it works good in a continuation run. Click here to see the script for activating a opened window/browser.

_______________________________________
Please send your Suggestions and Doubts to my yahoo group http://in.groups.yahoo.com/group/qtpsudhakar

18 comments :

  1. Sudhakar,Without the VO definition files, how would this concept be applied to VirtualList (select method), VirtualEdit (set method) etc.? In other words, how would this concept be extended to allow selecting a value from a List that is hidden to QTP, or set a value to a Textbox in the same manner? In the other post, you mentioned that a Virtual Object uses the properties Name, Height, Width, X, Y. This is true to an extent, because the Name is the name assigned by QTP and does not represent itself as a defining property. You might need to add these limitations so readers are not confused as to what is truly possible through this approach.Also, since you're tied to using coordinates, how would this be any different from referring to the target object as a generic object (WinObject) and using coordinates for it to work instead of using a VirtualObject? (as posted on SQAForums: <a href="http://www.sqaforums.com/showflat.php?Cat=0&Number=622737&page=0&vc=1&PHPSESSID=#Post622737">link</a>

    ReplyDelete
  2. Sudhakar Reddy KakunuriApril 17, 2010 at 8:24 AM

    Anshoo,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.Low level recording is useful for windows applications but not for web. When you want to create a virtual object in side an object of a web page, Low level recording is not suggestible. Because it treats the total web page as a win object. But you want to create in this hierarchy Browser("").Page("").Image("").VirtualButton("").clickIf you use low level recording it will be Window("").WinObject("").VirtualButton("").clickVirtual Objects are more understandable and reliable than Low Level recording. Because we can create them with different hierarchies.

    ReplyDelete
  3. [quote]For Virtual Lists you need to use one more property "rows:=number" and use "rows:=number", "columns:=number" for virtual table.[/quote]I tried several ways of doing this but without the VO data files, QTP will not select any value from the list.[quote]Virtual Objects are more understandable and reliable than Low Level recording. Because we can create them with different hierarchies. [/quote]Certainly more understandable, but can you please explain how this would be a reliable approach? Is it really reliable to use coordinates or an object's width/height to define any object in the AUT?[quote]When you want to create a virtual object in side an object of a web page, Low level recording is not suggestible. Because it treats the total web page as a win object. But you want to create in this hierarchy Browser("").Page("").Image("").VirtualButton("").click[/quote]This is quite true from a usability point of view. [quote]Virtual Objects are more understandable and reliable than Low Level recording. Because we can create them with different hierarchies. [/quote]Don't think I understand this.. How are they more reliable since both rely on the same concept of object recognition - ofcourse, with different object hierarchies.

    ReplyDelete
  4. Sudhakar Reddy KakunuriApril 20, 2010 at 8:24 AM

    [quote]I tried several ways of doing this but without the VO data files, QTP will not select any value from the list.[/quote]Does it worked using VO Data files. If so it should work with DP also. Remember that the statement works good in continuation run. If it is the first statement on the application then it may not work.[quote]Don't think I understand this.. How are they more reliable since both rely on the same concept of object recognition - ofcourse, with different object hierarchies.[/quote]That different object hierarchies makes the virtual object reliable than lowlevel recording. Let's say there is an image like this(http://cid-8ddf980c45482279.skydrive.live.com/self.aspx/QTP.10.Docs/google.JPG). Assume that the image is having some quicklinks which qtp is not recognized. You can create virtual objects with respect to that image. No problem If that image coordinates are changed because we have created the virtual object with respect to image. If you use low level recording it always use the main parent object. For the same situation lowlevel recording will not work when the image coordinates are changed. So obviously when compared with low level recording Virtual Objects are reliable. If low level recording is having a facility to recognize all web objects ( Links, Edits, Buttons, elements...etc) as winobjects then i can give equal rating for both lowlevel and Virtual Objects. But low level recording treats total page as win object and it will not recognize other objects. That's the reason I told low level recording is for windows applications not for web.What ever I told here its all related to web applications. When it comes to windows applications Lowlevel recording and virtual objects will become same. But Virtual objects are having more facilities to handle checkbox and radio buttons.There is no hidden things in Virtual Objects Descriptive Programming. It's just an alternative for VOT files. Like Object Repository and Descriptive Programming.

    ReplyDelete
  5. Hi Sudhakar
    Am using a Evaluation version of QTP 11 to identify if it works for window Based JAVA application.

    My application make use of SWT Nebulla Widgets and QTP is only identifying a Java Object but not all the objects within Class "SWT_Window".
    To solve this issue I tried to use SWT extensibility option of QTP 11.
    There are some built in extension files in installation path of QTP i.e. c:\Program Files\HP\QuickTest Professional\bin\java\classes\builtin

    I copied those files to c:\Program Files\HP\QuickTest Professional\bin\java\classes\extension.

    NOW I can see this extension(SWT) on starting QTP 11 when add inn window appears on start up, However SWT objects are not getting identified, neither Object Identification option in Tools showing any Test Object classes for SWT.

    I can see all these classes are lying there in mic.jar which is common for all the addins.

    QTP do have a help in the form of QuickTest Java Add-in Extensibility Tutorial but thats more of creating SWT extension from scratch. Do somebody have idea about QTP 11 Extensibility, and tell me accurate steps to add SWT Extension and how can I make use of In build XML(SWT.xml)????

    ReplyDelete
  6. HI Sudhakar.

    could you help me to get the quotation for qtp single user licence..,

    yeturus@gmail.com

    ReplyDelete
  7. hi sudhakar

    i wanna to validate the virtual object . is there any possibilities have to done it . if so kindly help me

    ReplyDelete
  8. hi sudhakar,
    i am using QTP 10 on windows 7.i have saves all my tests in D drive and have saved this path in QTP to lookup for resorces.
    now when i create a VO there is no such VO template file in dat folder.
    what is the problem?

    how can i use the VO which i hv created using VO manager?

    ReplyDelete
  9. hi
    Does QTP 11 suports Windows 7

    ReplyDelete
  10. yes windsows 7 supports QTP 11

    ReplyDelete
  11. Nice post Sudhakar, its good to know about the DP for Virtual Objects. This is first time I am using Virtual Objects. Keep going. Thanks

    Chandra.

    ReplyDelete
  12. Thanks to Explain about VO

    ReplyDelete
  13. sudhakar i want to create a virtual object for ms _paint using virtual object manager,after creating VOT how i call this? pls assist me.

    ReplyDelete
  14. Hi Sudhakar,

    Need your help, please guide me. My Scenario is:

    In the website, i have 2 edit fields user and password, but they are not identified as individual standard objects, these 2 objects are embedded in only one object which is identified as winobject.

    1. I have tried using with differend Add-ins, those objects could not be recognized.
    2. I tried using virtual object manager, but couldnot get through.

    Please provide me the solution.
    If any contact number please share it with me

    Thank you.
    Balu

    ReplyDelete
  15. does it DP works on different screen resolution, since there is x and Y coordinate?

    ReplyDelete
  16. Hi Sudhakar,

    Does QTP support SharePoint??

    Vinod Reddy Bojja

    ReplyDelete