def select_all_from_list(self, locator):
"""Selects all values from multi-select list identified by `id`. Key attributes for lists are `id` and `name`. See `introduction` for
details about locating elements.
"""
self._info("Selecting all options from list '%s'." % locator) select = self._get_select_list(locator)
if not select.is_multiple:
raise RuntimeError("Keyword 'Select all from list' works only for multiselect lists.") for i in range(len(select.options)):
select.select_by_index(i)

方法名:select_all_from_list(self, locator)

公共方法 选中所有选项,适用于multi-select list

接收参数:locator

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

13、14行:遍历所有options,并选中

使用:

输出结果:

INFO : Selecting all options from list 'id=creOutTime'.

Selenium2Library系列 keywords 之 _SelectElementKeywords 之 select_all_from_list(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. CSS3:empty

    :empty ---空的元素样式 <!DOCTYPE html> <html> <head lang="en"> <meta charse ...

  2. 在eclipse中调试web项目的时候如何把web项目分配给配置好的服务器

    举个例子,我今天在做spring和struts2整合的例子 新建项目blk 1.配置好web.xml,struts.xml,applicationContext.xml,写好jsp页面 2.把stru ...

  3. 资源 之 4.4 Resource通配符路径 ——跟我学spring3

    4.4.1  使用路径通配符加载Resource 前面介绍的资源路径都是非常简单的一个路径匹配一个资源,Spring还提供了一种更强大的Ant模式通配符匹配,从能一个路径匹配一批资源. Ant路径通配 ...

  4. spring各个包之间的依赖关系

    从图中可以看到: 1.spring core,spring beans被其他较多包依赖,spring aop,spring context,spring expression分别被两个包依赖,而spr ...

  5. 《Linux/Unix系统编程手册》读书笔记9(文件属性)

    <Linux/Unix系统编程手册>读书笔记 目录 在Linux里,万物皆文件.所以文件系统在Linux系统占有重要的地位.本文主要介绍的是文件的属性,只是稍微提及一下文件系统,日后如果有 ...

  6. 19.allegro过孔设置[原创]

    一.根据线宽设置过孔 在规则管理器下 --- --- ---- --- --- 二.设置原点 法1: -- -- 法二: 然后鼠标点选 ---option栏目在哪? --- 三:过孔问题1 当一个过孔 ...

  7. bash/shell 数学计算

    $ echo $((20.0/7)) $ zcalc $ bc <<< 20+5/2 $ bc <<< 'scale=4;20+5/2' $ expr 20 + 5 ...

  8. 读写INI辅助类

    using System.Text; using System.Runtime.InteropServices; using System; namespace Benson.INI读写 { #reg ...

  9. blade全集

    http://daylerees.com/codebright/blade

  10. ionic中登陆逻辑控制

    问题 登陆成功后从login.html调转到home.html,此时在home页面按back键又回到了login.html . 解决方案 登陆成功后,清除导航历史堆栈. 具体代码 menu.html ...