Element not found on a while #1563
-
Hello, i'm trying to solve a problem. When I make a loop, my script works perfectly. However, at some point, I don't know why, it can't find one of the elements. Maybe because one of the actions before the one it is going to do has not been done, and so it stops the script. I thought of putting sleeps, or if else, or try catch, with continue; But is there any other solution with Seleniumbase? Thanks a lot!
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
You might want to use You can probably optimize most of your selectors if you run the following on your script: pytest --rec-print |
Beta Was this translation helpful? Give feedback.
You might want to use
self.type()
instead ofself.send_keys()
, becauseself.send_keys()
won't clear out the text field first if there's text already in it. Also, it's difficult to see what your script is trying to do because you're using long selectors that might not be very stable.You can probably optimize most of your selectors if you run the following on your script: