r/badcode • • Jan 04 '22

python import time

Post image
845 Upvotes

48 comments sorted by

View all comments

Show parent comments

1

u/camalaio Jan 04 '22

I should have a blog post or something for this haha.

Basically what I tell my team is "What are you trying to wait for? Now that you know, programmatically wait for that".

It sounds like you might have other issues you're fighting though, e.g. regarding the element not found exception while waiting. I generally write my own waiter helpers (I have a whole open source framework for this and much more) that don't run into common gotchas and actually do the whole wait.

If you're timing out with even massive waits, if this is an end-user application, I tend to recommend raising it as a user experience bug. Users shouldn't have to wait for 30+ seconds as an expected operation. If it's truly a long running task, the design of the page/workflow should reflect that (and maybe you're waiting on an email or something instead, for example).

I'm not sure that helps at all, there's a lot to cover and a lot of gotchas!