-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Can't click an inline <a> that contains a block element #653
Comments
Clicking the This looks superficially similar to https://bugzilla.mozilla.org/show_bug.cgi?id=1307760, though the |
Looks quite similar to #322 |
I'm experiencing the same problem still with the following: System
|
any update on this one? i experience the exact same problem as the submitter reported. clicking the anchor doesn't work, but clicking the child div works, and changing the anchor style to display: block also fixes it. the Exception i get is org.openqa.selenium.ElementNotInteractableException: Element <a href="http://www.example.com/"> could not be scrolled into view i'm using clicking this anchor works fine with chromedriver 2.33 and ie driver 3.0.0.0 |
(Disclaimer: I don't speak for Mozilla) AFAIU, that is indeed the same problem, even though it's a different error message. The new WebDriver-compliant click code in FF58 produces that error instead of silently failing to click. I haven't checked again, but IIRC what was happening with that anchor is that Firefox thinks it has multiple client rects, and the first client rect isn't what you'd expect: The center point is (8, 2.5), which ends up being "above" the link that we're trying to click. |
thanks for the reply @juangj . have you come up with a workaround you're satisfied with, or are you waiting on a geckodriver or firefox fix? clicking the anchor through selenium works great in firefox 47.0.1 and the latest versions of chrome and ie (and of course works if i manually click in the browser with firefox 58, not using selenium). i'm reluctant to change all the html to use display: block for the anchor in such situations, for a variety of reasons (including my not having control over all the html). and i don't love the idea of clicking the child of the anchor when it's the anchor itself that has all the click handlers configured on it and should be the right thing to click. anyone on the mozilla side have info on when/if we could expect a fix for this issue, either in geckodriver or a new version of firefox? looks like this has been broken for 8 months, just with varying errors (click does nothing now replaced with ElementNotInteractableException). i'm surprised this issue only has a few comments on it, as it broke the first test i tried to run with geckodriver. maybe this use of anchors and divs in this fashion isn't that common, or perhaps lots of people are still sticking with 47.0.1, as we will continue to be until we can get our tests passing using geckodriver. thanks. |
I'd suggest just clicking the child div, even though, as you say, it's more logical to be clicking the anchor. It's a little annoying once, but it's straightforward and is simple enough to undo after this gets fixed. I think that's better than changing the HTML under test solely to work around an automation bug -- the explanatory comment that you leave in the code about this will make more sense if it's written in your test code rather than in your HTML templates. This bug affects a relatively small fraction of tests in my codebase, but of course everybody's experience will vary, depending on the thing that you're testing. |
Any updates on this? Still an issue with geckodriver 20.1 and FF 59. In my case, I have a dropdown with only anchor elements. They have no child elements I could use to click on, so this issue is a complete blocker for me. Works fine with chromedriver |
Any news on it? We have the problem with this sort of HTML:
|
Just to confirm that this is still a bug in Geckodriver 0.26.0. Is there any news on the resolution of this issue, is there anything that can be done to help with its resolution? |
Please note that work related to this problem is tracked on https://bugzilla.mozilla.org/show_bug.cgi?id=1374283. Sadly we don't have an ETA right now. Sorry. |
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
There is a bug in Geckodriver which means that it is unable to click any link which contains a block level node. See mozilla/geckodriver#653. The workaround is to click on it's first descendant instead. This is achieved thorugh finding it's first child and clicking that instead. Note: This is not a perfect workaround as the first child element may not be the one containing the block element, but normally this situation only occurs where the only immediate child is a block element.
Firefox Version
52.0 and 53.0b9 and 55.0a1
Platform
Linux (haven't tried others but it's probably the same)
Steps to reproduce -
This works with Chromedriver.
block.html
block.py
Geckodriver log
geckodriver.log.txt
The text was updated successfully, but these errors were encountered: