def state_city(): i = random.randint(0,3) j = random.randint(0,1) driver.find_element_by_id(form_locators.state).click() driver.implicitly_wait(10) driver.find_element_by_id(form_locators.state_list.format(i)).click() driver.find_element_by_id(form_locators.city).click() driver.implicitly_wait(10) driver.find_element_by_id(form_locators.city_list.format(j)).click()
def login(): username = "******" password = "******" driver.implicitly_wait(20) driver.find_element_by_xpath(signin.Tab_signin).click() driver.implicitly_wait(20) driver.find_element_by_id(signin.txt_email).send_keys(username) driver.find_element_by_id(signin.txt_password).send_keys(password) driver.find_element_by_id(signin.Btn_signin).click()
def failed_test(): driver.find_element_by_id(homepage.My_address).click()
def send_element(element, value): driver.find_element_by_id(element).send_keys(value)
def submit(): driver.find_element_by_id(form_locators.submit).click() driver.implicitly_wait(5) driver.find_element_by_id(form_locators.close).click()
def address(): send_element(form_locators.current_address, data.address()) submit = driver.find_element_by_id(form_locators.submit) driver.execute_script("arguments[0].scrollIntoView(true);", submit) # to scroll into view dropdown elements and submit button