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 ...
随机推荐
- Enum枚举 简单的使用
在枚举中使用抽象方法 /** * 为枚举类定义一个抽象方法,<br/> * 这个抽象方法由不同的枚举值提供不同的实现 * * @author wangzhu * @date 2014-9- ...
- KMP笔记√//找最大子串,前缀自匹配长度
假设s1里找s2,然后s2进去匹配假设在第三位失配那么说明前两位是匹配成功的 如果这时候将s2后移一位相当于将s2的第一位和s2的第二位比较,如果我们已知s1(1)≠s1(2)那么就可以直接后移两位 ...
- A. Counting Kangaroos is Fun(贪心)
#include<stdio.h> #include<algorithm> using namespace std; ]; int main() { int i,n,high; ...
- C#中SaveFileDialog 和OpenFileDialog 的用法
1.OpenFileDialog private void btnOpen_Click(object sender, EventArgs e) { OpenFileDialog ofd = new O ...
- Wireshark抓包分析HTTPS与HTTP报文的差异
一.什么是HTTPS: HTTPS(Secure Hypertext Transfer Protocol)安全超文本传输协议 它是一个安全通信通道,它基于HTTP开发,用于在客户计算机和服务器之间交换 ...
- Intellij IDEA 新建一个EJB工程(三)
之前都是用IDEA启动JBoss服务器,并在启动的同时将EJB项目部署上去.在构建 artifacts 时遇到很多问题,明明是EJB项目却不能用EJB导出,真是奇怪~~ 后来用Web Applicat ...
- Spring IoC — 基于XML的配置
1.属性注入 注意点: 1)如果类中显示定义了一个带参的构造函数,则一定还要显示提供一个无参构造函数,否则使用属性注入时将抛出异常. 2)JavaBean关于属性命名的特殊规范.Spring只会检查B ...
- JVM学习笔记(一)------基本结构
从Java平台的逻辑结构上来看,我们可以从下图来了解JVM: 从上图能清晰看到Java平台包含的各个逻辑模块,也能了解到JDK与JRE的区别 对于JVM自身的物理结构,我们可以从下图鸟瞰一下: 对于J ...
- Android权限安全(12)apk安装在sd卡上时,如何保证数据安全
apk安装在sd卡上时,如果把sd卡拿下安在另一个手机B上,那么apk的数据就可以被B里的恶意应用访问了. 下面是android解决这个问题的方案: 绑定设备 1,绑定perDevice使得应用以及应 ...
- Web内容管理系统 Magnolia 启程-挖掘优良的架构(3)
Author and Public instances 第一个关键观念:instance-实例.每一个项目都必须至少有一个Author实例和至少一个Public实例.下面将告诉你为什么: 基本概念:J ...