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

How we can deal with stale element reference with selenium libray?We need a keyword to deal with stale element reference #1792

Open
everlighting opened this issue Oct 7, 2022 · 3 comments

Comments

@everlighting
Copy link

Prerequisites

For issues

Steps to reproduce the issue

Create a simplified example which reproduces the problem. It is good if the example
can be run also by us, but this is not always mandatory.

Error messages and additional information

If there is an error, run the test with --loglevel trace set from command line
and copy paste the full stack trace to the issue. Use https://gist.github.com/ or
similar service for anything that longer than few lines.

Provide other details which might be useful for investigating the issue. Screenshots
from application or from unexpected dialogues are example useful. Sometimes showing
relevant parts of the log.html is useful too.

Expected behavior and actual behavior

When I follow those steps, I see...

I was expecting...

Environment

Browser: Name and version (Usually available from the about dialogue.)
Browser driver: Name and version
Operating System: Name and version (Linux, Ubuntu 18.04)
Libraries

  • Robot Framework: Version
  • Selenium: Version
  • SeleniumLibrary: Version
  • Interpreter: Name and version

Feature requests

Describe the need or the feature you are missing from the SeleniumLibrary. Also it
is useful to understand why you need such feature. Many times, it is useful to provide
few examples for acceptance tests. Try to avoid technical or implementation details,
those will handled later.

This project is not funded by any organisation or company, I do this because I
want to do this on my own free time. Therefore if you want feature be implemented,
the easiest and usually fastest way usually is to provide pull request. See
https://github.com/robotframework/SeleniumLibrary/blob/master/CONTRIBUTING.rst
for mode details about project development.

@emanlove
Copy link
Member

emanlove commented Oct 7, 2022

Could you expand upon what you are looking for you you say "We need a keyword to deal with stale element reference"? I am not sure what types of requirements you are looking for.

@Brownies
Copy link
Contributor

Brownies commented Oct 7, 2022

Duplicate of #1767

In the meantime, you can use and extend a SeleniumLibrary plugin like this to handle stale elements.

@aaltat
Copy link
Contributor

aaltat commented Oct 7, 2022

Every Wait * keyword has automatic suppression of stale element reference exception, which was very much debated when I did made the change.

In my opinion it is wrong to suppress the stale element reference exception in assertion type of keywords, like Click Element because exception is an indication of failure. Also retry will, most likely, lead to different type of problems. Instead users should invents in SUT testability and find a way to ask from the application when it is ready to receive the action. One way is using the https://pypi.org/project/robotframework-seleniumtestability/ but other also exist.

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

No branches or pull requests

4 participants