Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_value(self, locator)
2015-04-26 15:25
405 查看
def get_selected_list_value(self, locator): """Returns the value of the selected element from the select list identified by `locator`. Return value is read from `value` attribute of the selected element. 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 = self._get_select_list(locator) return select.first_selected_option.get_attribute('value')
方法名:get_selected_list_value(self, locator)
相似方法:
公共方法 返回首个选中项的value数组
接收参数:locator
10行:使用_get_select_list(self, locator)方法,返回Select对象
13行:返回首个选中项的value数组
使用:
输出结果:
INFO : ${value} = 0
相关文章推荐
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_values(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_label(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 _get_select_list_options_selected(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_labels(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_value(self, locator, *values)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_list_items(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_value(self, locator, *values)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list_options(self, select_list_or_locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list(self, locator, *items)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_label(self, locator, *labels)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 page_should_contain_list(self, locator, message='', loglevel='INFO')
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list(self, locator, *items)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_index(self, locator, *indexes)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_label(self, locator, *labels)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_selection_should_be(self, locator, *items)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_should_have_no_selections(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 page_should_not_contain_list(self, locator, message='', loglevel='INFO')
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_all_from_list(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 _get_labels_for_options(self, options)