Does anyone use this keyword for the below stated purpose and find it a good solution? Any other suggestions are appreciated.
When clicking on a grid to open a form, I have replaced the use of “Sleep” and “Wait Until Element is Visible” with "Wait Until Keyword Succeeds ". This appears to have reduced the number of failed tests where “StaleElementReferenceException” or “ElementClickInterceptedException” errors are thrown.
I also use “Set Selenium Implicit Wait” to 3s at the test level and timeout = 8 at the global level.
Wait Until Keyword Succeeds 1 1 sec click element //*[@id=“gridContainer”]/div/div/div/table/tbody/tr/td/div
I guess there is no reason not to do it that way if it works reliably for you.
As it appears you’re using SeleniumLibrray? I would have used Wait Until Element Is Visible first and then simply followed it with a click. Something like this:
Wait Until Element Is Visible //*[@id=“gridContainer”]/div/div/div/table/tbody/tr/td/div
click element //*[@id=“gridContainer”]/div/div/div/table/tbody/tr/td/div
Doing it your way will probably end up with many screenshots, 1 for each failed click, these screen shots might be useful? but they might also be an undesirable consumption of disk space, especially if you run CI builds.
The issue I was having using “Wait Until Element is Visible” is that I was getting too many timeouts. So when I set the arguments to retry 1 sec and retry interval 1, I only get one screenshot when fails
Maybe you need to wait the the page finishes loading before using
Wait Until Element is Visible? I’ve never needed to do that before but who knows.