Guest User

Untitled

a guest
Jan 17th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. Select(self.driver.find_element_by_id("currencyid")).select_by_visible_text("AUD")
  2. Select(self.driver.find_element_by_id("excur")).select_by_visible_text("AUD")
  3.  
  4. select1 = Select(self.driver.find_element_by_id("currencyid")).first_selected_option.text
  5. select2 = Select(self.driver.find_element_by_id("excur")).first_selected_option.text
  6. assert select1 == "USD"
  7. assert select2 == "CAD"
  8.  
  9. currency = Select(self.driver.find_element_by_id("currencyid"))
  10. excur = Select(self.driver.find_element_by_id("excur"))
  11.  
  12. currency.select_by_visible_text("AUD")
  13. excur.select_by_visible_text("AUD")
  14.  
  15. assert currency.first_selected_option.text == "USD" # should not be "AUD"?
  16. assert excur.first_selected_option.text == "CAD" # should not be "AUD"?
  17.  
  18. values = [("currencyid", "AUD"), ("excur", "AUD")]
  19. for id, value in values:
  20. select = Select(self.driver.find_element_by_id(id))
  21. select.select_by_visible_text(value)
  22.  
  23. assert select.first_selected_option.text == value
Add Comment
Please, Sign In to add comment