From 7ce8206c8771e1869e471944f23d02a32cd9d7fc Mon Sep 17 00:00:00 2001 From: axl89 Date: Tue, 14 Jun 2016 13:21:01 +0200 Subject: [PATCH] Added is_element_present function --- tests/console/include/common_functions_60.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/console/include/common_functions_60.py b/tests/console/include/common_functions_60.py index 86f64cec8a..4aab3484ee 100644 --- a/tests/console/include/common_functions_60.py +++ b/tests/console/include/common_functions_60.py @@ -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