-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
[python] provide element locator in the error when element is invisible #3917
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
Comments
Which browser are you using? If it is htmlunit driver, then you may want to file the bug here: https://github.com/SeleniumHQ/htmlunit-driver/issues. |
Isn't stacktrace enough to point to the element in code that is not visible? I'm personally inclined to keep it as is, especially since it's rather easy to extend error message in frameworks (at least with Ruby), but let's hear from other committers. |
Yes, it's htmlunit and I'm going to create issue in their bug tracker as you've suggested. Thanks! |
If you think this should no longer be an bug in Selenium, please close this issue. |
I'm using RobotFramework with a plugin for Selenium and the only way to see this stacktrace is to enable debug level. Also I'm running tests on TravisCI and when test fails I couldn't get the report at all. A minor improvement that I'm asking makes debugging process much easier. |
I'm not against that, however there are complications that are needed to be taken into account. For example, if we take id from element, what should we do for elements that have no id? |
It's a good question. I suspect that it will be hard to construct something like a full path to the element ( |
When we're trying to interact with invisible element from Python library we got an exception with the following message:
You may only interact with visible elements
. When this message is showing to user it doesn't help him to debug this situation because it miss the information about element itself.I'm suggesting to include element locator in the error message, for example:
Element id=my-bth is invisible. You may only interact with visible elements
.(I was initially reported this to the Selenium2Library (https://github.com/robotframework/Selenium2Library/issues/769) but author has said that this is Selenium issue.)
The text was updated successfully, but these errors were encountered: