Thursday, August 11, 2011

Failure to recognize certain new java objects on record

Failure to recognize certain new java objects on record

QTP has issues recording an R12 object called an ITEMTREE which was a list of expandable items that
look like this:
+40907824 ITEM1
+40907839 ITEM2
The following statements resulted after selecting an item during recording, but these would not play back:
nca_tree_select_item("ITEMTREE_ITEMTREE_0", "40907824 ITEM1 ");
nca_tree_activate_item("ITEMTREE_ITEMTREE_0", "40907824 ITEM1 ");
If you encounter this object, or any other new object that vugen has trouble with, this tip may get you around the recording limitation.


Practical Solution:
We used QuickTest Pro’s ObjectSpy to examine the ITEMTREE object and found that each menu item had a reference number that is selectable and plays back correctly. We then modified the VUgen code with the correct reference numbers:
nca_tree_select_item("ITEMTREE_ITEMTREE_0", "409");
nca_tree_activate_item("ITEMTREE_ITEMTREE_0", "409");

This reference number is listed in the detail log files if you look carefully but they were not obvious during recording, but we recommend using ObjectSpy if you encounter any other objects that VUgen doesn’t handle correctly.

No comments:

Post a Comment