本文整理汇总了Python中selenium.webdriver.support.ui.WebDriverWait.getText方法的典型用法代码示例。如果您正苦于以下问题:Python WebDriverWait.getText方法的具体用法?Python WebDriverWait.getText怎么用?Python WebDriverWait.getText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类selenium.webdriver.support.ui.WebDriverWait
的用法示例。
在下文中一共展示了WebDriverWait.getText方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_register_new_user
# 需要导入模块: from selenium.webdriver.support.ui import WebDriverWait [as 别名]
# 或者: from selenium.webdriver.support.ui.WebDriverWait import getText [as 别名]
def test_register_new_user(self):
driver = self.driver
account_button = driver.find_element_by_xpath(".//*[@id='global-nav']/div/div[2]/div[1]/ul/li[2]/a")
account_button.click()
# get the Create Account button
'''
registered_users_login = self.driver.find_element_by_xpath(".//*[@id='send2']/span/span")
self.assertTrue(registered_users_login.is_enabled() and registered_users_login.is_displayed())
'''
#Click on Register Button
register_button = driver.find_element_by_xpath(".//*[@id='login-form']/div/div/div[2]/div/button/span/span")
register_button.click()
self.assertEqual("Create New Customer Account",str(driver.title))
#first_name = self.driver.find_element_by_id("firstname")
first_name = WebDriverWait(driver,10).until(lambda driver:driver.find_element_by_id("firstname"))
last_name = driver.find_element_by_id("lastname")
email_address = driver.find_element_by_id("email_address")
company_primarily = driver.find_elememt_by_xpath(".//html")
print company_primarily.text
company_primarily1 = WebDriverWait(driver,10).until(lambda driver:driver.find_elememt_by_xpath(".//*[@id='customer_company_type']"))
Select(company_primarily1).select_by_visible_text("Other")
role = WebDriverWait(driver,10).until(lambda driver:driver.find_element_by_id("customer_individual_role"))
print role.getText()
Select(role).select_by_visible_text("Technical/developer")
#Select(driver.find_element_by_id("customer_individual_role")).select_by_visible_text("Technical/developer")
Screen_name = WebDriverWait(driver,10).until(lambda driver:driver.find_elememt_by_id("screen_name"))
Screen_name.send_keys("FIRST")
password = WebDriverWait(driver,10).until(lambda driver:driver.find_elememt_by_id("password"))
password.send_keys("[email protected]")
confirmation = WebDriverWait(driver,10).until(lambda driver:driver.find_elememt_by_id("confirmation"))
confirmation.send_keys("[email protected]")
first_name.send_keys("Radhika")
last_name.send_keys("Goel")
email_address.send_keys("[email protected]")
driver.find_elememt_by_id("security_updates").click()
driver.find_elememt_by_id("registerSubmit").click()