I have been trying to test a tooltip in my web page using Selenium WebDriver with Firefox 19.
I'm basically trying to use mouse actions to hover over the element that has the tooltip attached in order to test that the tooltip is displayed and to hover over another element to test that the tooltip is hidden.
The first operation works fine but when hovering over another element the tooltip remains visible. This issue does not occur when testing the webpage manually.
Has anyone else encountered this issue before? I'm using Ubuntu 12.04.
It seems that the Advanced Actions API relies on native events, which are disabled in the Linux version of Firefox by default. Therefore, they must be enabled in the WebDriver instance explicitly.
FirefoxProfile profile = new FirefoxProfile();
//explicitly enable native events(this is mandatory on Linux system, since they
//are not enabled by default
profile.setEnableNativeEvents(true);
WebDriver driver = new FirefoxDriver(profile);
Also, in my case I needed to upgrade the WebDriver to version 2.31 since the hover(moveToElement
) action did not work properly on 2.30 even with native events explicitly enabled. Tested this with version 2.31 of WebDriver and versions 17 and 19 of Firefox on Linux.
For more information you may check this link:
http://code.google.com/p/selenium/wiki/AdvancedUserInteractions#Native_events_versus_synthetic_events