Implicit waits should really only be used when initializing your driver
(if ever). Explicit waits are much easier to track when debugging and are designed to be more fine-grained, such as inside a Page Object.
Setting an implicit wait time on your driver
has a global effect on your wait times while keeping the setting fairly hidden from the consumer or future maintainer. This can be problematic especially when paired with explicit wait times via WebDriverWait
. You could end up with unexpected additions to your wait times.
Here's an example of an explicit wait:
var webDriverWait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
webDriverWait.Until(ExpectedConditions.ElementExists(By.Id("testId"));
A more thorough comparison of the pros and cons between the two and when to use them can be found here.