Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Selenium2Library/keywords/_selectelement.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@ def select_from_list(self, locator, *items):
try: option_index = option_labels.index(item)
except: continue
select_func(select, options, option_index)
if option_index is None:
raise ValueError("%s doesn't exist in list '%s'." % (items_str, locator))

def unselect_from_list(self, locator, *items):
"""Unselects given values from select list identified by locator.
Expand Down Expand Up @@ -219,6 +221,8 @@ def unselect_from_list(self, locator, *items):
try: option_index = option_labels.index(item)
except: continue
self._unselect_option_from_multi_select_list(select, options, option_index)
if option_index is None:
raise ValueError("%s doesn't exist in list '%s'." % (items_str, locator))

# Private

Expand Down