Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selenium Ruby issue with geckodriver - Selenium::WebDriver::Error::ElementNotVisibleError: for elements that are visible according to the DOM #179

Closed
danqa opened this issue Aug 12, 2016 · 5 comments

Comments

@danqa
Copy link

danqa commented Aug 12, 2016

I have a modal window that opens in my web page. The modal is long so you have to scroll to the bottom of it. When that happens part of the modal (the top) is hidden to the user as its above the top fold of the browser window. When this happens and selenium wants to access an element that is in that part of he modal you get:

Selenium::WebDriver::Error::ElementNotVisibleError:
       Element is not visible

The element is not hidden according to the DOM yet selenium cannot see it. This is new behavior with geckodriver as the firefox driver could interactive with this type of element. Is this now intended behavior? It seems that it should not be if the element is not hidden according to the DOM.

@andreastt
Copy link
Contributor

Currently Marionette uses the same visibility algorithm atom as Selenium and FirefoxDriver, so this is a little surprising. The intention is to move to the WebDriver specification definition of pointer-interactability in the future. You can try this new behaviour now by setting the specificationLevel capability to 1. It would be interesting to see if that acts differently.

I’m assuming the error you describe above happens when you try to interact with the element, e.g. click it. Is this the case?

The future definition of whether an element is interactable will be if the centre point of the first DOM element rectangle is inside the viewport or not.

@AutomatedTester
Copy link
Contributor

As Andreas points out we are using the code from the Selenium project. Without steps to reproduce (which include a script and HTML) there isnt much we can do.

@danqa
Copy link
Author

danqa commented Aug 22, 2016

Hi there. Sorry I have not responded sooner but was out of the country the last 10 days. @andreastt You are correct that the issue happens when I try to interact with an element that it is now not in the viewport. What happens it the modal is larger that the window. I click a button that generates an error (expected behavior) but the modal moved down to show that error. Now the element I want to interact with is not in viewport. When I run this on firefox 47 it works fine. On version 48 it is now giving the error above. @AutomatedTester I cannot provide an example as this is happening in a part of the system that I cannot provide outside access to. I will see if I can create a reproducible script for you to see what is occurring.

@danqa
Copy link
Author

danqa commented Aug 23, 2016

Haven't been able to create a script yet but wanted to give more context. As I said this issue is with a modal window that pops-up in our system. This issue does not occur on the main browser window. So for example, if I do window.scrollTo(0,500) the main window scrolls down. If I do this when the modal is open the main window scrolls in the background the the modal doesn't move. I suspect this is why selenium view the element. This is what is different from firefoxDriver to geckodriver that would cause this issue now. I'll continue to see if I can generate an example script.

@lock
Copy link

lock bot commented Aug 17, 2019

This issue has been automatically locked since there has not been any recent activity after it was closed. If you have run into an issue you think is related, please open a new issue.

@lock lock bot locked and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants