def testExpectedConditionAttributeToBeIncludeInElement(driver, pages): pages.load('booleanAttributes.html') with pytest.raises(TimeoutException): WebDriverWait(driver, 1).until( EC.element_attribute_to_include((By.ID, 'inputRequired'), 'test')) value = WebDriverWait(driver, 2).until( EC.element_attribute_to_include((By.ID, 'inputRequired'), 'value')) assert value is not None
def RentalApplicationSubmission(br): try: WebDriverWait( chrome_webdriver, 5, EC.element_attribute_to_include( By.XPATH, '//*[@id="rent_doc"]/form/table/tbody/tr[11]/td/div/input')) except: print("Timeout RentalApplicationSubmission") return # check agree1 selectitem = br.find_element_by_xpath( '//*[@id="rent_doc"]/form/table/tbody/tr[11]/td/div/input') selectitem.click() # check agree2 selectitem = br.find_element_by_xpath( '//*[@id="rent_doc"]/form/table/tbody/tr[13]/td/div/input') selectitem.click() # Application submission selectitem = br.find_element_by_xpath( '//*[@id="rent_doc"]/form/table/tbody/tr[14]/td/center/a[1]') selectitem.send_keys(Keys.ENTER) #final OK! WebDriverWait(br, 10).until(EC.alert_is_present()) # 아래 주석을 제거해야 최정적으로 예약함 br.switch_to.alert.accept()