I'm getting TimeoutExceptions while clicking an element intermittently. I have tried with explicit waits and time.sleep(). It works for a while and again i get exceptions.
I want to understand if it is caused by expected condition.
WebDriverWait(self.driver, 40).until(EC.element_to_be_clickable((By.XPATH, <locator> ))).click()
Will it help to avoid timeoutexception if I use below condition?
element = WebDriverWait(self.driver, 40).until(EC.presence_of_element_located((By.XPATH, <locator> )))
element.click()