Add is_element_present and activate_home_screen functions

This commit is contained in:
cesar991 2016-07-11 14:31:16 +02:00
parent c4e3d546da
commit a1067c1be6
1 changed files with 22 additions and 0 deletions

View File

@ -81,5 +81,27 @@ def detect_and_pass_all_wizards(driver):
detect_and_pass_initial_wizard(driver)
detect_and_pass_newsletter_wizard(driver)
def activate_home_screen(driver,mode):
click_menu_element(driver,"Edit my user")
Select(driver.find_element_by_id("section")).select_by_visible_text(mode)
driver.find_element_by_id("submit-uptbutton").click()
def activate_home_screen(driver,mode):
click_menu_element(driver,"Edit my user")
Select(driver.find_element_by_id("section")).select_by_visible_text(mode)
driver.find_element_by_id("submit-uptbutton").click()
-def is_element_present(driver, how, what):
from selenium.common.exceptions import NoSuchElementException
try:
driver.implicitly_wait(5)
driver.find_element(by=how, value=what)
except NoSuchElementException:
driver.implicitly_wait(5)
return False
driver.implicitly_wait(30)
return True