Can't hover to cause popup to display

89 views
Skip to first unread message

Chris Date

unread,
Mar 25, 2014, 10:43:14 AM3/25/14
to seleniu...@googlegroups.com
I am very new to Selenium, and based on another's team work, I have a project that uses WebDriver.dll and WebDriver.Support.dll (2.40.0.0), with IEDriverService.exe (2.39.0.0).

The product we're testing has a control which, while the mouse is hovering over it, causes a popup to display, and when the mouse moves away from the control (and popup) to somewhere else on the screen, the popup disappears. Pretty standard fare. But Selenium isn't actually moving the mouse to the control, and so when we tell it to Hover, if it's firing the event that triggers the display of the popup at all, I think it's immediately thereafter triggering the mouseout event causing the popup to disappear again, so quickly that one can't tell it ever opened in the first place.

Is there some way around this?

Sudhansu Sekhar panda

unread,
Mar 27, 2014, 8:23:16 AM3/27/14
to seleniu...@googlegroups.com
Hi Charlie,

Use this code 

Actions builder = new Actions(driver); 
 
 builder.moveToElement(driver.findElement(By.xpath("loactor"))).build().perform();

Thanks,

Sudhansu, 

Doug Dragon

unread,
Mar 27, 2014, 3:19:28 PM3/27/14
to seleniu...@googlegroups.com
"execute_script" may help as well  (this is in Python):

driver.execute_script("jQuery('%s').mouseover()" % selector)

-Doug

Afzal

unread,
Mar 28, 2014, 5:41:10 AM3/28/14
to seleniu...@googlegroups.com

Hi 

I agree with Sudhansu approach.

Regards,
Afzal

Alberto Scotto

unread,
Mar 28, 2014, 3:04:54 PM3/28/14
to seleniu...@googlegroups.com
Hi Chris,
After hovering as suggested..
Provided the popup is implemented as an actual DOM element like a div, then you may use an explicit wait waiting for that element to be visible.

Reply all
Reply to author
Forward
0 new messages