watir
watir copied to clipboard
Retry Element Not Clickable
The W3C spec is defining element interactability, and requiring it to be checked before clicks & send keys. It is even getting its own error code.
A user on Slack had an issue with a css animation covering the element in a way that it was temporarily visible, but not clickable. We should consider rescuing & retrying similar to a stale element error.
I think we decided that this isn't the right solution to this problem, so I'm closing.
So, we need some kind of solution to this. I think it requires Watir::Executor
and us figuring out which the default needs to be. :)
@titusfortner Hi, This is one of the essential feature, whats the problem in adding this feature? Recently Firefox has given the exception class for this error.
Selenium::WebDriver::Error::ElementClickInceptedError
So we can rescue as we are rescuing for some of the other errors.
Because there are multiple reasons for a click to be intercepted, so we don't want to force wait on this always. You can write your own method that rescues this exception and does the wait you need. The long term fix is to implement an Executor that can be customized by the user as desired.
@titusfortner I know the various conditions, there are permanent overlay and there are temporary overlay,Its not suitable for permanent overlay, but what's the harm in rescuing this? If it's permanent overlay, user will anyhow come to know the error after 30 seconds, he is not going stuck there indefinitely. Yes?
In principle I completely agree with you. We just need to allow the option for users with a permanent overly to rescue the exception and handle it differently. If Watir auto rescued and retried, then they'd be dealing with a Timeout exception instead of a click intercepted exception.
@titusfortner but timeout execption in WATIR is clearly telling us about timeout because of what! It's telling us it's timeout because unable to locate element or timeout for element to be present ,yes? So we need to include the error for this as well, for an example timeout because of element overlay. Actually either we can create one more rescue section or we may include this exception class along with other exception class by simply putting comma and we need to receive the error by =>e and then we need to inform the user about the specific error.
If you have an implementation idea, submit a PR and we can evaluate it. I'd love to do this by default. Just keep in mind the limitations found here: https://github.com/watir/watir/pull/534#issuecomment-283244188
@titusfortner Okay thanks, I will do. But I hope you aware of the fact that it only can be done for Firefox because Chrome still haven't provided any standard exception class for this.