Watir Webdriver fire_event onmouseover ya no funciona

I've been using Watir to automate testing of my companies primary web app. The tests require a javascript dropdown menu fired by mouse over, and a link on that menu to be clicked.

$browser.link(:id=> 'element').fire_event "onemouseover"

Was working perfectly until we changed the look and feel of the app. The changes made to the look in feel didn't appear to change in any way how the HTML looks and the menus work. Everything else is working fine with Watir.

I've tried using a solution that seemed to work for others, by including:

 class Watir::Element
  def hover
   assert_exists
   driver.action.move_to(@element).perform
  end
 end

y utilizando

  browser.div(:id => "someId").hover

But when the menus appear they instantly go away before the driver has a chance to click the menu item.

preguntado el 09 de marzo de 12 a las 15:03

I thought the latest version of watir-webdriver implemented the .hover method -

2 Respuestas

browser.div(:id => "someId").hover

sueño 3

Will solve the problem. I have faced same issue and sleep solved it :)

Respondido el 05 de junio de 13 a las 08:06

I've managed to get around this one (provided the site uses jquery) by using execute_script to fire off some jquery to override the visibility on the 'hidden' menus. See this answer https://stackoverflow.com/a/8392467/409820 para más información

Needing to do that was one reason I and others requested the .hover method, so that is also something you could try.

(my scripts are still using that particular trick because a) it's working, and b) I'm working on other stuff right now and don't have a pressing need to fiddle with them.

contestado el 23 de mayo de 17 a las 12:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.