Selenium2Library系列 keywords 之 _SelectElementKeywords 之_get_select_list_options(self, select_list_or_locator)

1     def _get_select_list_options(self, select_list_or_locator):

2         if isinstance(select_list_or_locator, Select):

3             select = select_list_or_locator

4         else:

5             select = self._get_select_list(select_list_or_locator)

6         return select, select.options

方法名:_get_select_list_options(self, select_list_or_locator)

私有方法 返回Select 元素对象和options集合

接收参数:Select 对象或locator

第2行:判断传入的参数是否为Select类型

第3行:如果true,则直接赋值给select变量

第5行:否则使用_get_select_list(self, locator)方法,返回Select对象

第6行:返回Select对象和它的options集合

 

你可能感兴趣的:(selenium)