Skip to content

WebDriver specific method

horejsek edited this page Mar 5, 2013 · 1 revision

wait_for_element(timeout=10, message='', id_|class_name|name|tag_name|xpath[, parent_id|parent_class_name|parent_name|parent_tag_name])

Alias for WebDriverWait(driver, timeout).until(lambda driver: driver.get_elm(...), message).

driver.wait_for_element(id_='someid')

wait(timeout=10)

Alias for WebDriverWait(driver, timeout).

driver.wait().until_not(lambda driver: len(driver.get_elms('id')) > 10)

go_to([path[, query[, domain]]])

Go to page. It uses driver.get method.

Domain is parsed from current_url if you don't specify any, so you can define domain only once. Query can be string or dictionary. path can be whole URL.

driver.go_to(domain='google.com')
driver.go_to('search')  # See, I do not need to write again google.com.
driver.go_to(query={'q': 'hello from cool webdriverwrapper'})