Reputation: 61
Hello guys I have a simple question, for instance im using this code:
WebDriverWait(driver, 20).until(EC.element_to_be_clickable((By.CSS_SELECTOR, ".test-name")))
print("ELEMENT FOUND")
Does it wait explicitly 20 seconds, or does it wait only until it finds the element and waits a maximum of 20 seconds if not found?
Upvotes: 1
Views: 368
Reputation: 12499
It wait only until it finds the element and waits a maximum of 20 seconds if not found
Wait will ignore instances of NotFoundException that are encountered (thrown) by default in the 'until' condition, and immediately propagate all others.
This waits up to 20 seconds before throwing a TimeoutException unless it finds the element to return within 20 seconds. WebDriverWait by default calls the ExpectedCondition every 500 milliseconds until it returns successfully. A successful return is for ExpectedCondition type is Boolean return true or not null return value for all other ExpectedCondition types.
Upvotes: 1