Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_values(self, locator)
def get_selected_list_values(self, locator):
"""Returns the values of selected elements (as a list) from the select list identified by `locator`. Fails if there is no selection. 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_selected(locator)
if len(options) == 0:
raise ValueError("Select list with locator '%s' does not have any selected values")
return self._get_values_for_options(options)
方法名:get_selected_list_values(self, locator)
相似方法:
公共方法 返回所有选中项的values数组
接收参数:locator
10行:使用_get_select_list_options_selected(self, locator)方法返回Select 元素对象和选中options数组
13行:返回所有选中项的value数组
使用:
输出结果:
INFO : @{values} = [ 0 | 1 | 2 ]
Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_values(self, locator)的更多相关文章
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_label(self, locator, *labels)
def unselect_from_list_by_label(self, locator, *labels): """Unselects `*labels` from ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_value(self, locator, *values)
def unselect_from_list_by_value(self, locator, *values): """Unselects `*values` from ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_index(self, locator, *indexes)
def unselect_from_list_by_index(self, locator, *indexes): """Unselects `*indexes` fro ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list(self, locator, *items)
def unselect_from_list(self, locator, *items): """Unselects given values from select ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_label(self, locator, *labels)
def select_from_list_by_label(self, locator, *labels): """Selects `*labels` from list ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_value(self, locator, *values)
def select_from_list_by_value(self, locator, *values): """Selects `*values` from list ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list(self, locator, *items)
def select_from_list(self, locator, *items): """Selects `*items` from list identified ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_should_have_no_selections(self, locator)
def list_should_have_no_selections(self, locator): """Verifies select list identified ...
- Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_selection_should_be(self, locator, *items)
def list_selection_should_be(self, locator, *items): """Verifies the selection of sel ...
随机推荐
- 【转】Wireshark:“There are no interfaces on which a capture can be done ”
linux环境下 两种解决方案: 第一种方法:使用root用户登陆 xiaoshancun@xiaoshancun-VM500:~$ sudo wireshark 第二种方法 ...
- MQTT客户端与服务代理的案列
服务端,采用 Mosquitto 来转发分发消息. 客户端自己写. 服务端 启动 mosquitto (底下的命令是我自己放到环境变量里面的,通过alias 运行mosquitto) Ishallbe ...
- [hackerrank]John and GCD list
https://www.hackerrank.com/contests/w8/challenges/john-and-gcd-list 简单题,GCD和LCM. #include <vector ...
- MySQL 建表字段长度的限制
脑补,varchar(N),N指的是最大字符数,不是字节数. 先上测试说明: 在MySQL建表时,遇到一个奇怪的现象: root@localhost : test 10:30:54>CREA ...
- Java 按字节获得字符串(中文)长度
引自:http://songjianyong.iteye.com/blog/1552973 package cn.com.songjy.test; import java.io.Unsupported ...
- NOT EXISTS优化的一个案例 .
原始语句: SELECT * FROM dcf_account.t_posting_transaction t1 WHERE NOT EXISTS ( SELECT * FROM dcf_loan.t ...
- 【转】深入解析cookie
来源:http://www.freebuf.com/articles/web/42802.html 写的超级详细,mark下,刚好学习爬虫的时候,有用到cookie模仿登录的,就顺便了解下. 0×00 ...
- C#中Dictionary的用法及用途
Dictionary<string, string>是一个泛型 他本身有集合的功能有时候可以把它看成数组 他的结构是这样的:Dictionary<[key], [value]> ...
- RegexOne
http://regexone.com/ http://regexone.com/lesson/optional_characters? http://regexone.com/lesson/capt ...
- Failed to initialize monitor Thread: Unable to establish loopback connection解决方法
原因一: android中出现该异常的原因,是pid产生了冲突,将服务中的windows Firewall 服务停用就行了 原因二: http://stackoverflow.com/question ...