1

Earlier I was using Firefox 25.0.1 and Selenium 2.42.2 to test my web-app. It consists of a menu tab, hovering over which gave sub menus and then I have to click on one of the sub menus. I was using following code:

Actions actions = new Actions(getFFWebDriver());
Action action = actions.moveToElement(getFFWebDriver().findElement(By.id("main.menu"))).build();
action.perform();
getWebDriver().findElement(By.xpath("//*[@id=\"submenu\"]/span")).click();

But when I upgraded my browser to version 28 it doesn't work like , it used to. I also tried upgrading selenium version to 2.46, still it doesn't work like as it used to with selenium 2.42 and FF-25.

Any help would be appreciated.

2
  • 1
    FF 25? That's really old
    – Saifur
    Jul 16, 2015 at 13:05
  • That's what on older version it was working great but even i upgrade my browser to 26 the above code break.
    – prab2112
    Jul 16, 2015 at 13:06

2 Answers 2

0

Native event support for firefox webdriver tend to be for a few specific versions of the browsers for each release of selenium. I suspect your versions of selenium doesn't support native events in firefox 28.

The changelog for V2.42 doesn't say what version of firefox they support for native events but apparently V28 of firefox was supported in V2.41. You could always try downgrading to that version of selenium or try firefox 33 on selenium V2.46 which looks like the latest version of firefox that has native event support.

https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG

There is also the option of going for synthetic events over native events.

3
  • I tried with the latest version of FF i.e 33 with selenium v 2.46 Still same issue.
    – prab2112
    Jul 17, 2015 at 10:25
  • You didn't upgrade to V39 by mistake did you? That is the latest version of FF but selenium won't support that for native events. Jul 17, 2015 at 14:40
  • No i didn't. Actually my sub menus are coming in such a way that due to that it's making it hard when i update FF. but also it works perfectly fine in chrome and FF25.
    – prab2112
    Aug 7, 2015 at 9:30
0

For me it works like this:

WebElement menu = driver.findElement(men);
        Actions builder = new Actions(driver);
        builder.moveToElement(menu).moveToElement(driver.findElement(submenu)).click().build().perform();

This works even i upgrade FF 25 -> 30 and also works well on Chrome.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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