Would you say you are experiencing a “not found” error message when implementing QuickTest Professional tests? This error pops up because QuickTest Professional can’t recognize non-standard objects during the playback session. To address this object recognition problem, we can utilize virtual objects.
Using the Virtual Object Wizard, we can link these unrecognized objects with a standard class, enabling us to record the test using a common object.
Recommended IPTV Service Providers
- IPTVGREAT – Rating 4.8/5 ( 600+ Reviews )
- IPTVRESALE – Rating 5/5 ( 200+ Reviews )
- IPTVGANG – Rating 4.7/5 ( 1200+ Reviews )
- IPTVUNLOCK – Rating 5/5 ( 65 Reviews )
- IPTVFOLLOW -Rating 5/5 ( 48 Reviews )
- IPTVTOPS – Rating 5/5 ( 43 Reviews )
=> Click Here For QTP Training Guide Series
Learnings Will Include:
Virtual Entities in QTP
How can we address the object recognition problem in QTP?
A Virtual Entity Example:
Consider the following situation: You are recording a test on a Microsoft Word document. You activate the pre-opened MS Word document and click on one of the icons in the top bar. For example, you click on “Format Painter”. The code noted down in QTP is as follows:
Window(<Microsoft Word>).WinObject(<NetUIHWND>).Click 132,120 Window(<Microsoft Word>).WinObject(<NetUIHWND>).Click 672,101
In instances like this, we can apply a virtual object. Technically speaking, a virtual object is an entity that is recognized by QTP as non-standard, but the tester specifically commands it to behave like a standard object.
Virtual Entity Wizard Navigation
Step #1: Navigate to the “Tools -> Virtual Entities -> New Virtual Entity” menu option and hit “Next” in the subsequent window.
Remember to brush up on the wizard’s functionality before moving to the next phase.
Step #2: You will be presented with a class list. Select a class that aligns with your object’s behavior in your program. In this scenario, the “Format Painter” icon acts more like a button, so I’ll select “Button” from the list.
Step #3: On this display, you’re allowed to mark the position of the object in your program. Hit “Mark Object” and select the object from your program.
Step #4: Once selected, the width and height values for the marked object will be filled in. Click “Next”.
Step #5: Configure how the selected object should be identified relative to its parent. You can choose to identify it based only on the parent object or on the entire hierarchy. I will keep the default values and click “Next”.
Step #6: Assign a name to your virtual object and add it to a collection (a consolidated list of virtual objects). I’ll keep the default values and press “Finish”.
This wraps up the creation of a virtual object.
Step #7: Visit “Tools -> Virtual Entities -> Virtual Entity Manager”. Here, you’ll find all the available collections and the objects within them.
Clicking on “New” will take you back to the creation process we just went through. You can delete a collection by using the “Delete” button.
After creating the virtual object, re-record the process on your application for the same object. The resulting code will resemble this:
Window(<Microsoft Word>).WinObject(<NetUIHWND>).VirtualButton(<button>).Click
Now, you can perform all operations on this virtual button that you could perform on a standard button object.
Notes:
#1) This feature is not available for analog and low-level recording methods.
#2) Based on the example, the reliability of the virtual object is mainly dependent on the width and height factors.
#3) To disable the recognition of virtual objects during recording, select the option “Disable recognition of virtual objects while recording” under “Tools -> Options -> General”.
Managing Errors in QTP
On occasion, while attempting to