My friend and I are working on a project that we hope will eventually be profitable. I have about two years of development experience, but we are patient and taking our time. We decided to start by developing a mobile app and later a web version.
I know React Native, but I’m wondering if there’s a better option for cross-platform development that could reduce the workload for making versions for other devices, starting with Android. If you have any thoughts on this, and things I should consider, please share. Thank you!
From my experience working with Selenium, I’d say Thread.sleep() is a straightforward way to pause your test execution when you know exactly how long you want to wait - like waiting for animations or page loads that don’t have reliable triggers.
It’s simple and effective but should be used sparingly because it always waits the full duration, which can slow down your tests unnecessarily. So, it’s good for quick fixes but not ideal for scalable automation.
Building on that, while Thread.sleep() can solve some timing issues, I recommend using it only when you can’t use better alternatives like explicit waits.
For example, Selenium’s WebDriverWait is smarter - it waits only as long as needed for a condition to be true, making tests more efficient. But in cases where you’re dealing with unpredictable delays or third-party components that don’t expose good wait conditions, Thread.sleep() still has its place as a fallback.
Adding to those points, it’s important to remember that Thread.sleep() should never be your first choice in Selenium automation because it introduces fixed delays that can either waste time or cause flaky tests.
Instead, use dynamic waits wherever possible, but keep Thread.sleep() handy for those rare situations — like waiting for visual effects or non-DOM changes where Selenium’s usual wait methods don’t work well. It’s more like a last-resort tool when you need a guaranteed pause.