plotly / plotly/dash

handle StaleElementReferenceException

Open
#1,164 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

P3 testing
Dominant language
Python
Stars
24.4k
Forks
2.3k
Avg merge
2d 7h
Merged PRs (30d)
13

Description

In https://github.com/plotly/dash-docs/pull/829 & https://app.circleci.com/pipelines/github/plotly/dash-docs/116/workflows/6647d2f6-4541-47fd-93fe-37d5f005f300/jobs/10757, I was getting the following error:

selenium.common.exceptions.StaleElementReferenceException: Message: stale element reference: element is not attached to the page document

This was hard to debug as I did not have this error locally. Some attempts at retrying didn't work, maybe I wasn't catching the right error (https://github.com/plotly/dash-docs/pull/829/commits/2c9fa1efbd76b8cec65bda34161290a210008fae, https://github.com/plotly/dash-docs/pull/829/commits/feb2482df0e9b8da311b517ca4a52db6631a3bdc)

In https://stackoverflow.com/a/44914767/4142536, there was a suggestion to use selenium's ignored_exceptions argument. Perhaps we can add that, and this common exception, to our wait_for_text_to_equal commands.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate the wait_for_text_to_equal commands and inspect how their Selenium waits are configured. Reproduce the CircleCI failure if possible, then verify that StaleElementReferenceException is handled by the wait and that the affected documentation tests complete successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
testing-qa
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.