James Parker - 2004-07-07

Logged In: YES
user_id=1074798

Here's an example snippet of an xml script I'm using at the
moment. It finds a navigator tree (JTree) that I have and
then right clicks on a node called "MyNode", the resulting
popup menu is found and the menu item called "Expand
Branch" is clicked.

<click node="MyNode"
popup="true"
refid="NavigatorTree"
type="JTreeMouseEventData"/>
<find finder="JMenuItemFinder"
id="PopupMenuItem"
index="0"
label="Expand Branch"/>
<click position="custom"
reference="22,11"
refid="PopupMenuItem"
type="MouseEventData"/>

This is NOT what you will get when you are doing an XML
recording. The main draw back of what you end up with from
an XML recording is that it chooses the menu item based on
an index and not on the name of the menu item being called.
Obviously, once the popup menu changes order you will
invalidate your scripts.

I suggest that once you have recorded your popup menu
action, you should stop recording, edit your script to this
minimal 3 step template as above, and then continue.

Happy scripting....

j.