Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Firefox driver is inconsistent when it has to scroll down to find an element to interact with #1861

Closed
lukeis opened this issue Mar 2, 2016 · 9 comments

Comments

@lukeis
Copy link
Member

lukeis commented Mar 2, 2016

Originally reported on Google Code with ID 1861

What steps will reproduce the problem?
1. Try to access an element that the browser has to scroll to interact with, using
the Firefox driver.
2. The Firefox driver sometimes fail to scroll down to find the element to interact
with.

What is the expected output? What do you see instead?
1. The driver should always scroll down, if the need be to access an element.

What version of the product are you using? On what operating system?
selenium-server-standalone-2.0rc2.jar and Firefox driver

Please provide any additional information below.
This is the relevant excerpt from the script that I used to reproduce this:

browser.get("http://guardian.co.uk");
browser.findElements(By.tagName("H2")).get(0).click();
browser.findElements(By.linkText("About us")).get(0).click();
browser.findElements(By.linkText("History of the Guardian")).get(0).click();
browser.findElements(By.tagName("SPAN")).get(20).click();


Excerpt from the stack trace is below:

org.openqa.selenium.ElementNotVisibleException: Element is not currently visible and
so may not be interacted with
System info: os.name: 'Linux', os.arch: 'i386', os.version: '2.6.38-2-686', java.version:
'1.6.0_25'
Driver info: driver.version: RemoteWebDriver
       at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
       at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:131)
       at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:105)
       at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:409)
       at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:201)
       at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:56)
       at TheGuardian.shareItWithAsIfYouAreWithMessage(TheGuardian.java:27)
Caused by: org.openqa.selenium.remote.ErrorHandler$UnknownServerException: Element
is not currently visible and so may not be interacted with



Reported by sdqali@sdqali.in on 2011-06-16 10:21:24

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

s/his/is/g in the title! 

Reported by sdqali@sdqali.in on 2011-06-16 10:24:36

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

To deal with DHTML menu you'd better use Actions:

browser.get("http://guardian.co.uk");
WebElement aboutMenu = browser.findElement(By.tagName("H2"));
new Actions(browser).moveToElement(aboutMenu).build().perform();
WebElement aboutMenuItem = browser.findElement(By.linkText("About us"));
new Actions(browser).moveToElement(aboutMenuItem).click().perform();

Reported by barancev on 2011-06-17 18:41:07

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by barancev on 2011-10-13 05:01:50

  • Labels added: Component-WebDriver, Browser-Firefox

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by dawagner on 2012-02-05 19:30:14

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Is this still an issue?

Selenium cannot click an element because it is not visible, it's correct behaviour.

Reported by barancev on 2012-06-01 19:51:14

  • Status changed: NeedsClarification

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Closing the issue due to inactivity.

Reported by barancev on 2012-11-29 08:02:00

  • Status changed: WontFix

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Hi:

Just wanted to point out that as of Selenium 2.26, the original code I posted works
fine.

Thank You!
~Sadique

Reported by sdqali@sdqali.in on 2012-12-07 10:31:17

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

I have the same problem with python Selenium driver (2.42.1), webdriver.Firefox().

It fails to scroll up to find an element to click on. That is, it locates the element
(the link), but fails to click on it. However, it does click on it if I manually scroll
selenium's browser.

Reported by orshansk on 2014-08-17 06:29:22

@lukeis
Copy link
Member Author

lukeis commented Mar 2, 2016

Reported by luke.semerau on 2015-09-17 18:13:03

  • Labels added: Restrict-AddIssueComment-Commit

@lukeis lukeis closed this as completed Mar 2, 2016
@SeleniumHQ SeleniumHQ locked and limited conversation to collaborators Mar 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant