I\'m moving some tests from Selenium to the WebDriver. My problem is that I can\'t find an equivalent for selenium.wait_for_condition. Do the Python bindings have this at the mo
Here's my version of Greg Sadetsky's answer, put into a function:
def click_n_wait(driver, button, timeout=5):
source = driver.page_source
button.click()
def compare_source(driver):
try:
return source != driver.page_source
except WebDriverException:
pass
WebDriverWait(driver, timeout).until(compare_source)
It clicks the button, waits for the DOM to change and then returns.