Fixed the is_element_present function by importing NoSuchElementException

This commit is contained in:
axl89 2016-06-14 13:24:17 +02:00
parent 7ce8206c87
commit 78a1a888fd
1 changed files with 3 additions and 2 deletions

View File

@ -60,6 +60,7 @@ def create_user(driver,userid,userpwd,email=None):
def is_element_present(driver, how, what):
try: driver.find_element(by=how, value=what)
except NoSuchElementException: return False
from selenium.common.exceptions import NoSuchElementException
try: driver.find_element(by=how, value=what)
except NoSuchElementException: return False
return True