My Selenium Webdriver tests broke recently after upgrading Firefox to version 19. In several of my tests I need to retrieve elements that are on the page but not visible on
I couldn't find an answer as to why WebDriver and/or Firefox behave the way they do. In my AUT I have a grid that displays a report and any cells/WebElements that are not visible on the screen I'm able to see in the Html, they do not appear to be hidden and WebDriver will admit it can see them however I can not retrieve any of the element's values, i.e. getText, getAttribute, etc. So to work around this limitation (not sure if it's a bug or just the way it behaves) I used the following little bit of JavaScript which seems to have resolved the issue for me:
private void scrollToElement(WebElement element){
((JavascriptExecutor) driver).executeScript("arguments[0].scrollIntoView(true);", element);
}
This was definitely a change in Firefox behavior from v16+. Hopefully someone else can also find this helpful.
Try the same thing by disabling native events like below
FirefoxProfile profile=new FirefoxProfile();
profile.setEnableNativeEvents(false);
DesiredCapabilities dc = DesiredCapabilities.firefox();
dc.setCapability(FirefoxDriver.PROFILE, profile);
driver = new FirefoxDriver(dc);
This is some work around to do page down
driver.findElement(By.tagName("body")).sendKeys(Keys.PAGE_DOWN);
Have you upgraded to selenium-server-standalone-2.31.0 ?