当前位置: 首页>>代码示例>>Python>>正文


Python Select.find_element_by_tag_name方法代码示例

本文整理汇总了Python中selenium.webdriver.support.select.Select.find_element_by_tag_name方法的典型用法代码示例。如果您正苦于以下问题:Python Select.find_element_by_tag_name方法的具体用法?Python Select.find_element_by_tag_name怎么用?Python Select.find_element_by_tag_name使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在selenium.webdriver.support.select.Select的用法示例。


在下文中一共展示了Select.find_element_by_tag_name方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_search_in_google

# 需要导入模块: from selenium.webdriver.support.select import Select [as 别名]
# 或者: from selenium.webdriver.support.select.Select import find_element_by_tag_name [as 别名]
 def test_search_in_google(self):
     driver = self.driver
     driver.get("https://www.google.co.in/")
     self.assertIn("Google", driver.title)
     signIn = driver.find_element_by_id("gb_70").send_keys(Keys.RETURN)
     signUP = driver.find_element_by_id("link-signup").send_keys(Keys.RETURN)
     firstName =driver.find_element_by_id("FirstName").send_keys("ABcd")
     lastName =driver.find_element_by_id("LastName").send_keys("XYza")
     userName =driver.find_element_by_name("GmailAddress").send_keys("abcd.xyz")
     password =driver.find_element_by_name("Passwd").send_keys("Abczyz#")
     confirmPass =driver.find_element_by_name("PasswdAgain").send_keys("Abczyz#")
     birthdayM = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div/div[1]/div/form/div[5]/fieldset/label[1]/span/div")
     all_option = Select.find_element_by_tag_name("option")
     for option in all_option:
          print ("Value is: %s") % option.getValue()
          option.setSelected()
     # birthdayD = driver.find_element_by_xpath("/html/body/div/div[2]/div/div[1]/div/form/div[5]/fieldset/label[2]/span").send_keys('11')
     # birthdayY = driver.find_element_by_id("BirthYear").send_keys("2014")
     # Gender = driver.find_element_by_xpath("/html/body/div[1]/div[2]/div/div[1]/div/form/div[6]/label/div/div[1]").click()
     # recnum = driver.find_element_by_id("RecoveryPhoneNumber").send_keys("9432123456")
     # email  = driver.find_element_by_id("RecoveryEmailAddress").send_keys("[email protected]")
     # tnc  = driver.find_element_by_id("TermsOfService").send_keys(Keys.RETURN)
     # nextS = driver.find_element_by_id("submitbutton").send_keys(Keys.RETURN)
     time.sleep(8)
开发者ID:kalpanakapoor11,项目名称:first,代码行数:26,代码来源:SignUp.py


注:本文中的selenium.webdriver.support.select.Select.find_element_by_tag_name方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。