Drop down box selection(Select)

http://www.cnblogs.com/yoyoketang/p/6128636.html

from selenium.webdriver.support.select import Select
Month=driver.find_element_by_id("input-creditCardExpirationMonth")
Select(Month).select_by_value("05")
Year=driver.find_element_by_id("input-creditCardExpirationYear")
Select(Year).select_by_value("2018")
Country=driver.find_element_by_id("input-creditCardCountry") 
Select(Country).select_by_index(4)

 

posted @ 2017-05-08 18:02  Linazhu  阅读(142)  评论(0编辑  收藏  举报