I have a question regarding the send_keys function. How can I make the test wait for the entire content of send_keys to be entered? I can not use time.sleep, so I tried:
WebDriverWait(self.browser, 5).until(
expected_conditions.presence_of_element_located((By.ID, "name")))
query = driver.find_element_by_id('name')
query.send_keys('python')
driver.find_element_by_id("button").click()
the app clicks the button before the action completes send_keys thank you for an answer
text valueof the element. As long as the wordpythonis not returned from the webelement, do not click yet. (Although in your example I'm fairly sure that atime.sleep(1)before your click would solve the problem, but you don't want to use it)send_keyswould return before it finished. For example, have you tried getting the value of the element right before clicking, to see what the browser returns? Could it be that you have some javascript attached to the input element that is causing some sort of delay?