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. 【重走Android之路】【开篇】序

    [重走Android之路][开篇]   [序]         本人Nodin,偶尔也叫MoNodin,朋友们都喜欢叫我丁,还有个笔名叫陌上幽人,文艺时叫恋风,发奋时叫不肯腐烂的土壤...也许你觉得我 ...

  2. Centos上的屏幕保护

    关闭Centos上的屏幕保护:setterm -blank 0 设置Centos上的屏幕保护为5分钟:setterm -blank 5

  3. HDU 4630 No Pain No Game 树状数组+离线查询

    思路参考 这里. #include <cstdio> #include <cstring> #include <cstdlib> #include <algo ...

  4. boot.img的分析

    1 boot.img  boot.img是由文件头信息,内核数据以及文件系统数据组成,它们之间非页面对齐部分用0填充 文件头信息的具体结构可以在system/core/mkbootimg/bootim ...

  5. php实现新闻页面

    首页 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8& ...

  6. 如何使页面滚动条移动到指定元素element的位置处?

    如何使页面滚动条移动到指定元素element的位置处? 在用selenium做测试时,会遇到需要操作的元素不在当前可视页面中的情况,如果是手工测试,自然很简单,手动拖拽滚动条到目标元素处即可. 那么, ...

  7. UVa 1593 (水题 STL) Alignment of Code

    话说STL的I/O流用的还真不多,就着这道题熟练一下. 用了两个新函数: cout << std::setw(width[j]);    这个是设置输出宽度的,但是默认是在右侧补充空格 所 ...

  8. HDU 1548 (最基础的BFS了) A strange lift

    这是一维的BFS,而且没有什么变形,应该是最基础的BFS了吧 题意: 有这样一个奇葩的电梯,你在第i层的时候你只能选择上或者下Ki层,也就是你只能从第i层到达i+Ki或者i-Ki层.当然电梯最低只能在 ...

  9. DOM应用

    父级.removeChild(子节点);父级.appendChild(子节点);父级.insertBefore(子节点, 在谁之前); 创建元素: <script> window.onlo ...

  10. C语言中的三值合一

    在学习C语言中我们会发现这样一种情况: #include<stdio.h> Int main() { Int ar[10]; printf(“%p\n”,ar); printf(“%p\n ...