Added is_element_present function

This commit is contained in:
axl89 2016-06-14 13:21:01 +02:00
parent fcf0f63e26
commit 7ce8206c87
1 changed files with 5 additions and 0 deletions

View File

@ -58,3 +58,8 @@ def create_user(driver,userid,userpwd,email=None):
driver.find_element_by_name("email").send_keys(email)
driver.find_element_by_id("submit-crtbutton").click()
def is_element_present(driver, how, what):
try: driver.find_element(by=how, value=what)
except NoSuchElementException: return False
return True