title: Unable to Execute Watir Hover or Mouseover Main Nav Menu
body: <p>I have been trying for about 2 days searching through the forums here and on google groups and none of what I have found has worked. Basically the top nav menu is put into the following HTML:</p>
  
  <pre><code>&lt;div id="topNav"&gt;
  &lt;div id="headerLogo"&gt;  
  &lt;div id="mainNav"&gt;
  &lt;ul id="nav"&gt;
  &lt;li id="navTab01" class="manageUsers"&gt;
  &lt;a class="mainNavItem" title="Manage Users And Groups" href="#"&gt; &lt;/a&gt;
  &lt;ul class="dropdown" style="display: none;"&gt;
  &lt;/li&gt;
  &lt;li id="navTab02" class="manageContent"&gt;
  &lt;a class="mainNavItem current" title="Manage Content" href="#"&gt; &lt;/a&gt;
  &lt;ul class="dropdown" style="display: none;"&gt;
  &lt;li class="manageSubRegions"&gt;
  &lt;li class="manageBusinessDirectoryEntries"&gt;
  &lt;a class="dropdownItemHasFlyout current" href="/BusinessDirectoryEntry"&gt; Business Directory&lt;/a&gt;
  &lt;ul class="flyout" style="display: none; left: 224px;"&gt;
  &lt;/li&gt;
  &lt;li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li id="navTab03" class="manageFinancials"&gt;
  &lt;li id="navTab04" class="runReports"&gt;
  &lt;/ul&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>The menu Item I want to manipulate is navTab002 which has the expanded HTML Of:</p>
  
  <pre><code>&lt;li id="navTab02" class="manageContent"&gt;
  &lt;a class="mainNavItem current" title="Manage Content" href="#"&gt; &lt;/a&gt;
  &lt;ul class="dropdown" style="display: none;"&gt;
  &lt;li class="manageSubRegions"&gt;
  &lt;a class="current" href="/SubRegion"&gt; Regions&lt;/a&gt;  
  &lt;/li&gt;
  &lt;li class="manageBusinessDirectoryEntries"&gt;
  &lt;a class="dropdownItemHasFlyout current" href="/BusinessDirectoryEntry"&gt; Business    Directory&lt;/a&gt;
  &lt;ul class="flyout" style="display: none; left: 224px;"&gt;
  &lt;li class="businessDirectoryEntryQuickAdd"&gt;
  &lt;a class="current" href="/BusinessDirectoryEntry/QuickAdd"&gt; Quick Add&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="manageBusinessCustomListings"&gt;
  &lt;a class="current" href="/BusinessDirectoryCustomListing"&gt; Sectors&lt;/a&gt;  
  &lt;/li&gt;
  &lt;li class="manageBusinessDirectoryProfileTypes"&gt;
  &lt;a class="current" href="/BusinessDirectoryProfileType"&gt; Profile Types&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="manageBusinessDirectoryPrivateTypes"&gt;
  &lt;a class="current" href="/BusinessDirectoryPrivateType"&gt; Private Types&lt;/a&gt;
  &lt;/li&gt;
  &lt;li class="displayOptions"&gt;
  &lt;a class="current" href="/DisplayOption"&gt;Display Options&lt;/a&gt;
  &lt;/li&gt;
  &lt;/ul&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>I want to click on the 3rd item in the drop down list on hover over (or mouse click) either work with it manually.</p>
  
  <p>The java script is using hoverIntent which (may) be causing a problem for me - not sure.</p>
  
  <p>When I used the console saving during a manual run I got:</p>
  
  <p>DOMNodeRemoved
  DOMSubtreeModified
  DOMNodeInserted
  DOMSubtreeModified
  DOMNodeRemoved
  DOMSubtreeModified
  DOMNodeInserted
  DOMSubtreeModified
  DOMNodeRemoved
  DOMSubtreeModified </p>
  
  <p>a bazzillion times.</p>
  
  <p>This is the log of coding I have attempted with ruby Watir:</p>
  
  <pre><code>irb(main):001:0&gt; require 'watir'
  =&gt; true
   &lt;Watir::Browser.start("http://services.leedsgrenville.com/")
  =&gt; #&lt;Watir::IE:0x4c618ca8 url="http://services.leedsgrenville.com/" title="Admin
  istration"&gt;
  &lt;ink(:index, 1).attribute_value("/BusinessDirectoryEntry")
  NoMethodError: undefined method `li' for main:Object
      from (irb):3
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):004:0&gt; browser.li(:text, 'Manage Users &amp; groups').link(:index, 1).at&gt;
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["li"], :text=&gt;"Manage Users &amp; groups"}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:135:in `document'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:31:in `document'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:136:in `each_element'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:21:in `block in each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:20:in `each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:20:in `each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:147:in `locate'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:33:in `locate'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:63:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:407:in `attribute_value'
      from (irb):4
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):005:0&gt; browser.li.flash
  =&gt; nil
  irb(main):006:0&gt; browser.li(id =&gt; "navTab02").flash
  NameError: undefined local variable or method `id' for main:Object
      from (irb):6
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):007:0&gt; browser.li(id =&gt; "navTab02").flash
  NameError: undefined local variable or method `id' for main:Object
      from (irb):7
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):008:0&gt; browser.li(index, 2).flash
  NameError: undefined local variable or method `index' for main:Object
      from (irb):8
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):009:0&gt; browser.li(index, 2)
  NameError: undefined local variable or method `index' for main:Object
      from (irb):9
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  &lt;nk(:text, /Manage Content/).fire_event('onmouseover')
  =&gt; ""
  &lt;(:text, /Manage Content/).fire_event('onmouseover')
  =&gt; ""
  &lt;(:text, /Manage Content/).fire_event('onmouseover')
  =&gt; ""
  irb(main):013:0&gt; browser.link(:text, /Manage Content/).flash
  =&gt; nil
  irb(main):014:0&gt; browser.link(:text, /navTab01/).flash
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["a"], :text=&gt;/navTab01/}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:280:in `flash'
      from (irb):14
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):015:0&gt; browser.link(:text, /navTab01/).flash
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["a"], :text=&gt;/navTab01/}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:280:in `flash'
      from (irb):15
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):016:0&gt; browser.link(:text, /Manage Content/).flash
  =&gt; nil
  irb(main):017:0&gt; browser.link(:text, /Manage Content/).flash
  =&gt; nil
  irb(main):018:0&gt;
  &lt;(:class =&gt; 'manageContent', :text =&gt; 'Manage Content').link.click
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["li"], :class=&gt;"manageContent", :text=&gt;"Manage Content"}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:135:in `document'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:31:in `document'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:136:in `each_element'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:21:in `block in each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:20:in `each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c 
  lassic/locator.rb:20:in `each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:147:in `locate'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:33:in `locate'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:63:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:412:in `perform_action'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:269:in `click!'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:211:in `click'
      from (irb):19
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  &lt;(:class =&gt; 'manageContent', :text =&gt; 'Business Directory').link.click
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["li"], :class=&gt;"manageContent", :text=&gt;"Business Directory"}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:135:in `document'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:31:in `document'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:136:in `each_element'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:21:in `block in each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:20:in `each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:20:in `each'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/locator.rb:147:in `locate'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:33:in `locate'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:63:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:412:in `perform_action'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:269:in `click!'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:211:in `click'
      from (irb):20
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):021:0&gt; browser.div(:id, "mainNav").fire_event "onmouseover"
  =&gt; ""
  irb(main):022:0&gt; browser.div(:id, "mainNav").fire_event "onmouseover"
  =&gt; ""
  irb(main):023:0&gt; browser.link(:id =&gt; "navTab01").click
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["a"], :id=&gt;"navTab01"}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:412:in `perform_action'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:269:in `click!'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:211:in `click'
      from (irb):23
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):024:0&gt; browser.link(:class =&gt; "manageUsers").click
  Watir::Exception::UnknownObjectException: Unable to locate element, using {:tag_
  name=&gt;["a"], :class=&gt;"manageUsers"}
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:66:in `assert_exists'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:412:in `perform_action'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:269:in `click!'
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:211:in `click'
      from (irb):24
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):025:0&gt; browser.div(:id, "mainNav").hover
  NoMethodError: undefined method `hover' for #&lt;Watir::Div:0x30b3610&gt;
      from C:/Ruby193/lib/ruby/gems/1.9.1/gems/watir-classic-3.1.0/lib/watir-c
  lassic/element.rb:431:in `method_missing'
      from (irb):25
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):026:0&gt; class Watir::Element
  irb(main):027:1&gt; def hover
  irb(main):028:2&gt; assert_exists
  irb(main):029:2&gt;
  irb(main):030:2*   driver.action.move_to(@element).perform
  irb(main):031:2&gt; end
  irb(main):032:1&gt; end
  =&gt; nil
  &lt;ll(:text, "Manage Content").fire_event("onmouseover")
  NoMethodError: undefined method `cell' for #&lt;Watir::IE:0x3276978&gt;
      from (irb):33
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  irb(main):034:0&gt; require 'WET'
  LoadError: cannot load such file -- WET
      from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
  n `require'
      from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:i
  n `require'
      from (irb):34
      from C:/Ruby193/bin/irb:12:in `&lt;main&gt;'
  </code></pre>
  
  <p>The Actual Java Code is:</p>
  
  <pre><code>$("#mainNav, #mainNavDropdown").hoverIntent(
  {
      interval: 200,
      timeout: 1000,
      over: function()
      {
          $(this).addClass("over");
          $("#mainNavDropdown").stop(true, true).slideDown(500,
                   function()
                   {
                       $(this).css("height", ""); // Make sure animation didn't screw up
                   });
      },
      out: function()
      {
          $(this).removeClass("over");
          if (!$("#mainNav, #mainNavDropdown").hasClass("over"))
              $("#mainNavDropdown").stop().slideUp(500,
                  function()
                  {
                      $(this).css("height", ""); // Make sure animation didn't screw up
                  });
      }
  });
  
  // Hide the menu on body click
  $("body")
      .click(function(evt)
      {
          if ($(evt.target)
                  .parents()
                  .andSelf()
                  .filter("#mainNav, #mainNavDropdown").length == 0)
              $("#mainNavDropdown").stop().slideUp(300,
                  function()
                  {
                      $(this).css("height", ""); // Make sure animation didn't screw up
                  });
      });
  </code></pre>
  
  <p>If anyone can attempt to help me that would be awesome!</p>