def get_selected_list_value(self, locator):
"""Returns the value of the selected element from the select list identified by `locator`. Return value is read from `value` attribute of the selected element. 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 = self._get_select_list(locator)
return select.first_selected_option.get_attribute('value')

方法名:get_selected_list_value(self, locator)

相似方法:

公共方法 返回首个选中项的value数组

接收参数:locator

10行:使用_get_select_list(self, locator)方法,返回Select对象

13行:返回首个选中项的value数组

使用:

输出结果:

INFO : ${value} = 0

Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_value(self, locator)的更多相关文章

  1. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_label(self, locator, *labels)

    def unselect_from_list_by_label(self, locator, *labels): """Unselects `*labels` from ...

  2. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_value(self, locator, *values)

    def unselect_from_list_by_value(self, locator, *values): """Unselects `*values` from ...

  3. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list_by_index(self, locator, *indexes)

    def unselect_from_list_by_index(self, locator, *indexes): """Unselects `*indexes` fro ...

  4. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 unselect_from_list(self, locator, *items)

    def unselect_from_list(self, locator, *items): """Unselects given values from select ...

  5. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_label(self, locator, *labels)

    def select_from_list_by_label(self, locator, *labels): """Selects `*labels` from list ...

  6. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list_by_value(self, locator, *values)

    def select_from_list_by_value(self, locator, *values): """Selects `*values` from list ...

  7. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_from_list(self, locator, *items)

    def select_from_list(self, locator, *items): """Selects `*items` from list identified ...

  8. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_should_have_no_selections(self, locator)

    def list_should_have_no_selections(self, locator): """Verifies select list identified ...

  9. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_selection_should_be(self, locator, *items)

    def list_selection_should_be(self, locator, *items): """Verifies the selection of sel ...

随机推荐

  1. cojs 简单的01串 题解报告

    题意显然是求n位二进制串中不大于其逆序串,取反串,逆序取反串的所有串按字典序排序后的第k个 由于n很小,k很大所以我们可以考虑逐位确定 问题转化为了求方案数,这显然是可以用数位DP做的 设f[len] ...

  2. iOS使用Charts框架绘制—柱形图

    首先看一下最终要实现的效果: 最终效果 一.初始化barChartView 绘制柱形图需要用到BarChartView这个类,下面是初始化代码: self.barChartView = [[BarCh ...

  3. java抓取动态生成的网页

    最近在做项目的时候有一个需求:从网页面抓取数据,要求是首先抓取整个网页的html源码(后期更新要使用到).刚开始一看这个简单,然后就稀里哗啦的敲起了代码(在这之前使用过Hadoop平台的分布式爬虫框架 ...

  4. 转ATL对象类型

    http://hi.baidu.com/rural_child/item/d91ce5d8fba9c8e73cc2cbf9 1.Objects a.Simple Object:用于实现业务逻辑,无用户 ...

  5. Shuffle和排序

    MapReduce确保每个reducer的输入都按键排序.系统执行排序的过程——将map输出作为输入传给reducer——称为shuffle.shuffle属于不断被优化和改进的代码库的一部分,从许多 ...

  6. vimrc示例

     1 "===============================================================================  2 "   ...

  7. 25-语言入门-25-n-1位数

    题目地址: http://acm.nyist.edu.cn/JudgeOnline/problem.php?pid=96    描述已知w是一个大于10但不大于1000000的无符号整数,若w是n(n ...

  8. ListView(1)几个重要属性,关闭滚动到顶部,底部的动画,item之间的分割线,背景等

    见表: android:stackFromBottom="true" 设置该属性之后你做好的列表就会显示你列表的最下面,值为true和false android:transcrip ...

  9. 用paint 计算字符串的像素宽度

    方法1: //直接返回参数字符串所占用的像素宽度 Paint paint = new Paint(); width = paint.measureText(str); 有一些view可以直接得到pai ...

  10. Android权限安全(7)binder,service,zygote安全相关简介

    binder 提供服务的service中的binder thread 检查调用者的uid 不是root,system就异常. service 也检查调用者的uid 不是root,system,只能注册 ...