A simple search in our test automation repository for “Thread.Sleep” returns over 600 instances in just the baseline regression suite alone. With an average of 10 seconds per instance, nearly 2 hours of wait time induced by using Thread.Sleep() alone. By enabling high reuse in the test automation code, this wait time could inherently be exponentially higher.
While I understand the intent and accept the need for waits in test scripts, shouldn’t these be replaced with smarter wait handlers such as explicit or fluent waits? It will definitely reduce the overall execution time.
Is it convenience or ignorance driving this behavior among test engineers? What are your thoughts?