def list_should_have_no_selections(self, locator):
"""Verifies select list identified by `locator` has no selections. 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.
"""
self._info("Verifying list '%s' has no selection." % locator)
select, options = self._get_select_list_options_selected(locator)
if options:
selected_labels = self._get_labels_for_options(options)
items_str = " | ".join(selected_labels)
raise AssertionError("List '%s' should have had no selection "
"(selection was [ %s ])" % (locator, items_str))

方法名:list_should_have_no_selections(self, locator)

公共方法 验证select list 没有项被选中

接收参数:locator

9行:使用_get_select_list_options_selected(self, locator)方法返回Select 元素对象和选中options数组

11行:使用_get_labels_for_options(self, options)返回选中options的labels数组

使用:

输出结果:

INFO : Verifying list 'id=creOutTime' has no selection.

Selenium2Library系列 keywords 之 _SelectElementKeywords 之 list_should_have_no_selections(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_selection_should_be(self, locator, *items)

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

  9. Selenium2Library系列 keywords 之 _SelectElementKeywords 之 get_selected_list_values(self, locator)

    def get_selected_list_values(self, locator): """Returns the values of selected elemen ...

随机推荐

  1. Mysql 1030 Got error -1 from storage engine 错误解决

    检查你的my.cnf或my.ini,里面会有一个参数innodb_force_recovery,你看看他的值,默认是没有这个参数,没有的话,他的默认值是0,这个参数的值如果大于0,innodb会被禁止 ...

  2. asp.net-(含:模拟登陆,照片列表)

    一.画好用户登录界面 同时换下请求的地址. 获取用户信息及判断代码插入位置: 一.画好用户登录界面 同时换下请求的地址. 获取用户信息及判断代码插入位置: <%@ WebHandler Lang ...

  3. floodlight make the VMs can not getDHCP IP address

    https://answers.launchpad.net/neutron/+question/242170 这个问题我也遇到了,但是没人回答. floodlight make the VMs can ...

  4. Eclipse jetty

    下载Eclipse的Jetty插件run-jetty-run http://download.csdn.net/detail/zhwq1216/7995627 当修改文件时,不需要进行服务重启设置 R ...

  5. C++和pascal之间的通信

    // MyFirst.cpp : 定义控制台应用程序的入口点.// #include "stdafx.h"#include "Winsock2.h"#pragm ...

  6. activiti5.13 框架 数据库设计说明书

    转载自:http://www.cnblogs.com/llzgzljl/p/3356108.html activiti5.13 框架 数据库设计说明书 1.结构设计 1.1.    逻辑结构设计 Ac ...

  7. apache配置优化

    最近参加了很多面试,多多少少有点小感悟,可以说观念转变了不少,特别是对于作为一个开发人员的定位,原来只是认为开发人员就只需要写好代码就行了,所以只需要有数据结构,算法,设计模式,重构方面的知识就行了. ...

  8. C语言的字符测试函数

    C语言的字符测试函数 isalnum, isalpha, isdigit, isxdigit, isblank, isspace, isascii, iscntrl, ispunct, isgraph ...

  9. dubbo/dubbox部署资料收集

    dubbo/dubbox部署资料收集 最近由于项目需要要部署bubbox,dubbo,在找资料过程中用的的一些网址如下,后来由于取消没有实际应用,以备今后再用 http://dubbo.io/Admi ...

  10. C++工具系列博文合集

    http://www.cnblogs.com/itech/category/240779.html