Skip to content
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

Stale element reference errors should report the element and/or line of code it considers stale #4184

Open
reallymello opened this issue Apr 10, 2024 · 2 comments · May be fixed by #4214
Open

Comments

@reallymello
Copy link
Contributor

Description

Often when automating pages that do in place updates of the DOM or if the same selector exists between state transitions Nightwatch may report a stale element reference in the test output during test execution (depending how defensively the test is written). While the error is logged, Nightwatch does not report which element or line of code it is executing that it considers stale which makes troubleshooting and resolving the error difficult--especially in large test suites. Often I have to set breakpoints and slowly narrow in on sections of code until I find it which can be very time consuming in larger test suites.

Suggested solution

Log the selector considered stale and/or the line of code so one can quickly identify what step is encountering a stale element exception.

For newer users, including the possible cause/solution messages similar to what was added for other error types may be helpful as well.

Alternatives / Workarounds

No response

Additional Information

No response

@pujagani
Copy link
Member

Thank you for providing the details. I am looking into it. I was able to come up with a solution that logs the selector for stale element reference error. I am now trying to enhance that to add the link of code to it.

@reallymello
Copy link
Contributor Author

Amazing, thank you

pujagani added a commit to pujagani/nightwatch that referenced this issue May 30, 2024
@pujagani pujagani linked a pull request May 30, 2024 that will close this issue
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants