-
Notifications
You must be signed in to change notification settings - Fork 785
Closed
Description
@aaltat
I have a demo website http://demo.robotframework.cn/.
There is a select list, it's html code is:

The keyword get_list_items docstring wrote it will return the values in the select list. But the result is:

I want to get the option value for "item1","item2","item3", but it returns the labels "first","second","third".
So I checked the keyword get_list_items source code:
`
def get_list_items(self, locator):
"""Returns the values in the select list identified by `locator`.
Select list keywords work on both lists and combo boxes. Key attributes for
select lists are `id` and `name`. See `introduction` for details about
locating elements.
"""
select, options = self._get_select_list_options(locator)
return self._get_labels_for_options(options)
`
It wrote 'returns the values', but it return self._get_labels_for_options(options).
I change the docstring to "Returns the labels", then add a keyword for get_list_values:
`
def get_list_values(self, locator):
"""Returns the values in the select list identified by `locator`.
Select list keywords work on both lists and combo boxes. Key attributes for
select lists are `id` and `name`. See `introduction` for details about
locating elements.
"""
select, options = self._get_select_list_options(locator)
return self._get_values_for_options(options)
`
So this is the issue for the pr #721
Reactions are currently unavailable
