If you have created some client functionality that is triggered when the user moves the mouse over an element, you may run into trouble testing with Selenium’s
I recently implemented such a feature using jQuery’s
hover event handler and pulled my hair out trying to test the functionality with Selenium. I went down a complete rat hole trying trigger the event within selenium using the
mouseOver just triggers
mouseover on the element. Now, if you have used jQuery’s
hover then you are binding your functionality to
Therefore, if you wish to test with Selenium, do not use jQuery’s
hover method and bind your functionality to
Note that many older browsers do not support
mouseleave as this was introduced by Microsoft and was not immediately adopted by the others. There is also a big difference in their behaviour and propagation in the event model.
mouseout bubble up whereas
mouseleave do not bubble up.