-
Notifications
You must be signed in to change notification settings - Fork 105
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
Add timeout
for Getter keywords which use a selector
#3371
Comments
@Snooz82 did you have an opinion about this feature request? |
I am really cautious about adding more arguments to so many keywords. I would really want to take some time to discuss these. this timeout would interfere with the normal timeout. And assertion timeout etc. we really do not want to end where SL is with all its timeouts. |
@Snooz82 - I well understand your hesitation. Once implemented, it's almost impossible to revert. But perhaps it helps to remember that this applies to pretty much any implementation you choose. I wouldn't see any "hidden magic" here - if there is a timeout, I can use it, but I don't have to. Anyway...
, I wonder why there is a timeout in assertions at all...? 🤔 In my opinion, a global fixed timeout of 1s in assertions is neither sensible nor practicable. |
To add a timeout to every assertion keyword, we would probably need to wrap the actual keyword and the That could create some confusions because the argument interface would be different in python than in RF. |
@simonmeggle now that i started implementing that and me seeing some of my team mates using waiters for assertion, what you are demanding already works. Just use
Therefore i would close that issue, after make some documentation changes explaining that principle. |
Hey @Snooz82 , that sounds like a good solution to the problem. Thanks for the hint! |
I often catch myself writing something like this:
(= click somewhere and do a text assertion)
The problem is that often times the pages takes time to load and
Get Text
is executed too early and fails then.I would therefore always have to write an
element-visible
assertion before such text assertions - because onlyWait For Elements State
allows me to set a custom timeout (e.g. 30s):It does not feel right to write two assertions (Wait For / Get Text) for exactly the same selector, just to achieve one goal (to assert a text).
retry_assertions_for
(as suggested by @mkorpela) is not a complete solution to the problem because each assertion can require another setting. The is no global setting which is right for all of them.Would it be an idea to add an optional
timeout
argument to theGet
-keywords which have a selector as argument?Thanks -
Simon
(Question was asked originally on Slack: https://robotframework.slack.com/archives/C015KB1QSDN/p1703179017661919)
The text was updated successfully, but these errors were encountered: