Skip to content

Support the "stale element reference" error from WebDriver #87

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

Merged
merged 4 commits into from
May 11, 2020

Conversation

ipkiss42
Copy link
Contributor

@ipkiss42 ipkiss42 commented May 9, 2020

This can happen when a handle on an element is kept but the element is
not on the page anymore (e.g. because it was removed from the DOM or
because the browser navigated to another page).

https://www.w3.org/TR/webdriver/#dfn-stale-element-reference

Note that I reused the existing NoSuchElement error variant. Let me know if you would prefer a new StaleElementReference error variant instead.

This can happen when a handle on an element is kept but the element is
not on the page anymore (e.g. because it was removed from the DOM or
because the browser navigated to another page).

https://www.w3.org/TR/webdriver/#dfn-stale-element-reference
@jonhoo
Copy link
Owner

jonhoo commented May 10, 2020

Ah, this is great, thank you! Could you please also add a test for this? The easiest way is probably to make the test use Client::execute to run some JavaScript that removes the element it just found.

@ipkiss42
Copy link
Contributor Author

Tests added. My first ones in Rust :)

@jonhoo jonhoo merged commit a4a0044 into jonhoo:master May 11, 2020
@jonhoo
Copy link
Owner

jonhoo commented May 11, 2020

Great, thank you!

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.

None yet

2 participants