? QA Design Gurus: Telerik Test Studio Tip: Use conditional wait rather than Thread.Sleep()

Jul 21, 2015

Telerik Test Studio Tip: Use conditional wait rather than Thread.Sleep()

It is not a good practice to write Thread.Sleep() to wait for the element presence. Instead, I recommend to write conditional waits on pages, frames, elements etc. If we write Thread.Sleep(), no matter whether the element is loaded or not, it will wait until specified timeout,  whereas in case of conditional wait, it will proceed with next step if it found the element before the specified timeout. It essentially means that  it will wait until timeout only in extreme cases and test case execution will take lesser time in most cases. Moreover, by gong with conditional waits, we can reduce a lot of execution time and also avoid a lot of synchronization problems.

No comments:

Post a Comment