Permalink
Browse files

Merge pull request #37 from rtomac/use_selenium_select_element_class

Fix select an item in a single selection list
  • Loading branch information...
2 parents 9d40897 + 878ad5f commit 242885aabb3ed0d7a4df636cdd0adba215410ca9 @emanlove emanlove committed Mar 4, 2012
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/Selenium2Library/keywords/_selectelement.py
@@ -1,4 +1,5 @@
from selenium.webdriver.remote.webelement import WebElement
+from selenium.webdriver.support.ui import Select
from keywordgroup import KeywordGroup
class _SelectElementKeywords(KeywordGroup):
@@ -262,8 +263,8 @@ def _select_option_from_multi_select_list(self, select, options, index):
options[index].click()
def _select_option_from_single_select_list(self, select, options, index):
- select.click()
- options[index].click()
+ sel = Select(select)
+ sel.select_by_index(index)
def _unselect_all_options_from_multi_select_list(self, select):

0 comments on commit 242885a

Please sign in to comment.