Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

If I automate mouse actions using Selenium2/Webdriver in combination with Firefox 12, I can easily get the "mouse" to move to and hover over a context menu so the sub-menus are seen. However, if I have the real mouse resting outside of the active window running the test, there's a 99% chance when the hover action occurs, the context menu will flash quickly and disappear as if the mouse had moved. This causes the next step in the test to fail since the web element is no longer visible.

Once in a blue moon the test will run fine if the mouse is outside of the window. That's definitely a rare instance. If the real mouse is resting anywhere inside of the active window running the test, the hover action and test will run without issue 100% of the time.

Has anyone experienced this behavior or is it a known issue of Selenium2/Webdriver and Firefox? If you have experienced this, although it doesn't seem likely there could be a workaround, have you found a way to counteract this behavior?

It's a pain to have to wait for a test to run if it contains a hover command instead of letting it go in the background while I continue working on something else.

share|improve this question
add comment

2 Answers

I did notice this behavior, but only while debugging. When I executed the tests normally I never saw the issue. Have you tried that?

share|improve this answer
    
I see the issue whether or not I run the test in Debug mode or as normal –  squeemish Jul 16 '12 at 18:43
add comment

I edit the firefox profile to disable native events. Also maximize window and it works fine

FirefoxProfile p = new FirefoxProfile();
p.setEnableNativeEvents(false);
WebDriver driver = new FirefoxDriver(p);    
driver.get("url");
driver.manage().window().maximize();
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.