Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_label(self, locator, *labels)
2015-04-28 22:48
471 查看
def select_from_list_by_label(self, locator, *labels): """Selects `*labels` from 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. """ if not labels: raise ValueError("No value given.") items_str = "label(s) '%s'" % ", ".join(labels) self._info("Selecting %s from list '%s'." % (items_str, locator)) select = self._get_select_list(locator) for label in labels: select.select_by_visible_text(label)
方法名:select_from_list_by_label(self, locator, *values)
相似方法:
公共方法 选中所有labels项
接收参数:locator,*labels
13行:使用_get_select_list(self, locator)方法,返回Select对象
相关文章推荐
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_label(self, locator, *labels)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_value(self, locator, *values)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list(self, locator, *items)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_index(self, locator, *indexes)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_value(self, locator, *values)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_all_from_list(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list(self, locator, *items)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list_options(self, select_list_or_locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list(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 之 list_selection_should_be(self, locator, *items)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_value(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_values(self, locator)
- 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 之 get_list_items(self, locator)
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 page_should_contain_list(self, locator, message='', loglevel='INFO')
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 _get_values_for_options(self, options)