Skip to content

fix(node): treat Ferrum's ExecutionContextDestroyedError and ForeignObjectError as a stale node - #403

Merged
route merged 1 commit into
mainfrom
fix/ferrum-context-destroyed-errors
Nov 30, 2026
Merged

route merged 1 commit into
mainfrom
fix/ferrum-context-destroyed-errors

Conversation

@route

@route route commented Nov 30, 2026

Copy link
Copy Markdown
Member

Ferrum moved two Chrome errors out of NodeNotFoundError in rubycdp/ferrum#755:

  • ExecutionContextDestroyedError: a command cut off by a navigation ("Inspected target navigated or closed", "Execution context was destroyed.").
  • ForeignObjectError: a Node or RemoteObject argument from a previous page or another isolated world ("Argument should belong to the same JavaScript world as target object").

Cuprite relied on them being NodeNotFoundError in three places, so now:

  • invalid_element_errors lists both, so Capybara finds the element again after either, e.g. a within element that went stale while Cuprite searched in it.
  • Node commands raise ObsoleteNode for both, as they did for NodeNotFoundError.
  • set doesn't fail when a navigation, e.g. a form submitted by typing Enter, cuts off the refocus after typing.

…bjectError as a stale node

Ferrum raises ExecutionContextDestroyedError for a command cut off by a navigation and ForeignObjectError for a node
argument from another page or world, both were NodeNotFoundError before (rubycdp/ferrum#755). Node commands raise
ObsoleteNode for them, Capybara finds the element again after either, and set doesn't fail when a navigation cuts
off its refocus.
@route
route merged commit 745be38 into main Nov 30, 2026
5 of 6 checks passed
@route
route deleted the fix/ferrum-context-destroyed-errors branch November 30, 2026 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant