Hey Nathan,

Would you like to add this to the FAQs or the general Watir documentation?

-Charley

On 1/2/07, Nathan <[EMAIL PROTECTED]> wrote:

So I will assume that you are talking about a menu that when your cursor
is over it, the menu drops down or appears, and then you can click on a
link, is this correct?  Here is a brief code snippet from one of my
scripts.  I will explain it in detail.

$objWatirBrowser.image(:id,
"menu_SearchInventory").fireEvent("onMouseOver") # Mouse over the menu
$objWatirBrowser.textField(:id,
"nav_new_vsZipCode").set($objProperties.strCurrentZipCode) # Set the zip
code
$objWatirBrowser.link(:id, "nav_new_vsZipCode_a").click # Click on the
Next image

$objWatirBrowser is an instance or object of IE.  You probably have
something similar already. The image I am referencing on the first line is
an image that represents my menu, maybe you have a div instead or something
else, then change it to what you need.  The fireEvent method after that
causes the browser to think that there is a mouse cursor over the
menu.  This results in making the menu appear or drop down.

On the second line I fill in a field that is located on my menu.  This is
pretty atypical (not normal), but you can do that if you need to.

On the third line I am clicking on a link that is in my menu again.  I
hope that this may help you somewhat in answering your question.  Basically
the steps I've taken here are:

1. Mouse Over the menu to make it appear
2. Enter data into a text field on the menu
3. Click on a link on the menu

Nathan
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5973&messageID=16724#16724
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to