-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Wait for proper non-stale element reference in WebDriverWait #1447
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
Wait for proper non-stale element reference in WebDriverWait #1447
Conversation
81bc417
to
72f986f
Compare
72f986f
to
2cdf27f
Compare
@anders-kiaer this looks great, thanks! Does the The test failure is likely not a problem, just a residual from the tests not running initially. We needed to adjust settings for fork PRs, after changing how we access docker images on CircleCI. If there's no more you intend to run here, an empty commit should resolve the failure. |
Thanks for the feedback @alexcjohnson. Yes, I changed it to draft since I saw there was a chance I would probably want to change the My current understanding (might be wrong) is that e.g.
will never fail on
during the The Lines 70 to 84 in e2f7884
WebDriverException which a broad range of other exceptions inherit from.
I guess it is a matter of preference, if you want to have common exceptions to ignore within As a side note, the use case that hit us randomly originally was |
If we can reduce spurious failures by ignoring more exceptions, without impacting real errors that users will care about, then absolutely let's do it! I'm not aware of any other exceptions in the I wouldn't be opposed to a new method - perhaps If so perhaps we should make |
Sorry for late response on this - have not been working on the Dash based project for some months 🍼
This is Mozilla's explanation of I tested adding your suggestion @alexcjohnson with If making |
thanks again for this @anders-kiaer - closing as stale (both Dash and Selenium have moved on). |
Resolves #1164.
My experience is that the stale reference appears more frequently in multi-page apps using
dcc.Location
/dcc.Link
, compared withdcc.Tabs
. When it happens, it is difficult to debug, as it happens a bit by random (even in CI context, with same initial setup, multiple test runs on a Dash app can sometimes go fine, sometimes fail withStaleElementReferenceException
).This PR ensures that the
WebDriverWait
waits until a proper non-stale reference exists to the element, inspired by link to StackOverflow post provided in #1164. By defaultselenium.webdriver.support.wait.WebDriverWait
only ignoresNoSuchElementException
.Contributor Checklist
StaleElementReferenceException
to list of ignored selenium errors while waiting on element.optionals
CHANGELOG.md