码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2015-04-26 12:14:25      阅读:115      评论:0      收藏:0      [点我收藏+]

标签:

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集合

 

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

标签:

原文地址:http://www.cnblogs.com/loveok-56/p/4457536.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!