-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
[🐛 Bug]: Python - staleness_of is crashing with Node with given id does not belong to the document #15401
Comments
@nijel, thank you for creating this issue. We will troubleshoot it as soon as we can. Info for maintainersTriage this issue by using labels.
If information is missing, add a helpful comment and then
If the issue is a question, add the
If the issue is valid but there is no time to troubleshoot it, consider adding the
If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C),
add the applicable
After troubleshooting the issue, please add the Thank you! |
@nijel can you provide a full reproducible code along with the url to reproduce this issue independently? It will help in triaging |
As mentioned before, it isn't reliably reproducible, it happens occasionally. To me, it looks like it needs to hit a certain time when the browser is in the middle of loading the next page and the selected element is still available (“Node with given id does not belong to the document”), but is not yet stale to trigger The snippet is from our test suite, in this particular case it is testing the login page which does nothing complex (a form where submit button is clicked). It can be seen online, for example, at https://hosted.weblate.org/accounts/login/. I've now got the failure with selenium logging enabled, posted the logs above, the full job is here: https://github.com/WeblateOrg/weblate/actions/runs/13806523670/job/38618335307 If you have any idea how to debug this deeper, I'm happy to include that in our CI. I don't think I've seen this issue before upgrading Selenium to 4.29.0 (from 4.28.1), but it might be just a coincidence (it might also be that the Chrome and/or ChromeDriver were updated inside the GitHub Actions meanwhile). |
https://issues.chromium.org/issues/375343406 might be related (but doesn't give much info). |
We're getting the same error in GitHub Actions quite often since two days ago. Happens with both Selenium 4.25.0 and 4.29.1. We're using Ruby with Capybara, though. My best guess is that it's related to a change in GitHub Actions and they're now using a different version of Chromium 🤔. Or maybe they changed something that made the tests slower and that somehow affects the results. Here's an example of a test run that failed a few times with Selenium 4.25.0 and another example with Selenium 4.29.1. We haven't been able to reproduce any of the failures, though, with each test run failing on different tests. |
Looking back at the workflow logs, I can't locate such an issue with Chromium 133.0.6943.0 / ChromeDriver 133.0.6943.141 which were used before. With Chromium 134.0.6998.0 / ChromeDriver 134.0.6998.35 there is quite likely that the test will fail. |
Chromium 134 seem to broke Selenium and it throws WebDriverException when element is about to get stale. This catches the error and retries the operation after a short delay. See SeleniumHQ/selenium#15401
Chromium 134 seem to broke Selenium and it throws WebDriverException when element is about to get stale. This catches the error and retries the operation after a short delay. See SeleniumHQ/selenium#15401
WeblateOrg/weblate#14187 seems to be a workaround for us. |
Chromium 134 seem to broke Selenium and it throws WebDriverException when element is about to get stale. This catches the error and retries the operation after a short delay. See SeleniumHQ/selenium#15401
We've used the setup-chrome action to run the tests with several versions of Chrome 132 and Chrome 133, each in combination with Selenium 4.25.0 first and then Selenium 4.29.1. We get the same behavior in all cases: apparently random "-32000 Node with given id does not belong to the document" errors with no apparent cause, even on simple tests that only go to a page, click on a button and check the result. The screenshots of the failures just show a regular browser window showing that everything apparently behaves as it should. With Chrome 132.0.6834.83 we also get another apparently random error (we still get the "-32000" error as well with this version):
|
We're getting this a lot in our RSpec system specs - the pattern that fails is this: click_link "Add post"
expect(page).to have_content("New post")
fill_in "Title", with: "Chrome/chromedriver 134 errors"
click_button "Submit"
expect(page).to have_content("Post updated successfully") Which gives an "Node with given id does not belong to the document" error because the redirect hasn't finished. When we set an expectation on the path the problem goes away: click_link "Add post"
expect(page).to have_content("New post")
fill_in "Title", with: "Chrome/chromedriver 134 errors"
click_button "Submit"
expect(page).to have_current_path("/posts") # wait for redirect
expect(page).to have_content("Post updated successfully") |
Possibly related: teamcapybara/capybara#2800. |
What happened?
The
staleness_of
predicate occasionally crashes with:selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
This happens like in a few percent of test runs. Maybe this error should consider the element to be stale as well?
How can we reproduce the issue?
Relevant log output
Operating System
Ubuntu
Selenium version
Python 4.29.0
What are the browser(s) and version(s) where you see this issue?
Chromium 134.0.6998.0
What are the browser driver(s) and version(s) where you see this issue?
ChromeDriver 134.0.6998.35
Are you using Selenium Grid?
No response
The text was updated successfully, but these errors were encountered: