• select_by value:参数为option中的value属性,例如:HTML代码中 <ignore_js_op> ,应该是value="volvo"这个值,所以应该为小写;
  • select_by_visible_text:参数为option的text值, <ignore_js_op> ,应该是红线标出部分的值,所以应该是大写;
  • Select(driver.find_element_by_name("isImportant")).select_by_visible_text(u"是")

  • deselect_all(self)

| Clear all selected entries. This is only valid when the SELECT supports multiple selections.
| throws NotImplementedError If the SELECT does not support multiple selections

  • select_by_index(self, index)

| Select the option at the given index. This is done by examing the "index" attribute of an
| element, and not merely by counting.
|
| :Args:
| - index - The option at this index will be selected
|
| throws NoSuchElementException If there is no option with specisied index in SELECT

  • select_by_value(self, value)

| Select all options that have a value matching the argument. That is, when given "foo" this
| would select an option like:
|
| <option value="foo">Bar</option>
|
| :Args:
| - value - The value to match against
|
| throws NoSuchElementException If there is no option with specisied value in SELECT
|

  • select_by_visible_text(self, text)

| Select all options that display text matching the argument. That is, when given "Bar" this
| would select an option like:
|
| <option value="foo">Bar</option>
|
| :Args:
| - text - The visible text to match against
|
| throws NoSuchElementException If there is no option with specisied text in SELECT

selenium Select用法笔记的更多相关文章

  1. python+selenium七:下拉框、选项框、select用法

    # from selenium import webdriverfrom selenium.webdriver.common.action_chains import ActionChainsimpo ...

  2. Selenium Grid 学习笔记

    Selenium Grid 学习笔记http://www.docin.com/p-765680298.html

  3. jquery中关于append()的用法笔记---append()节点移动与复制之说

    jquery中关于append()的用法笔记---append()节点移动与复制之说 今天看一本关于jquery的基础教程,看到其中一段代码关于append()的一行,总是百思不得其解.于是查了查官方 ...

  4. html select用法总结

    本文将介绍select 原生的常用方法,这些都是经过测试,兼容ie6到ie10,及chrome,火狐等,也就是说大部分浏览器都兼容.如果大家发现有不兼容的情况,可以跟我留言. 我们对基本的用法了如指掌 ...

  5. 网络通信 --> select()用法

    select()用法 头文件 #include <sys/time.h> #include <sys/types.h> #include <unistd.h> 定义 ...

  6. 【Python爬虫】selenium基础用法

    selenium 基础用法 阅读目录 初识selenium 基本使用 查找元素 元素互交操作 执行JavaScript 获取元素信息 等待 前进后退 Cookies 选项卡管理 异常处理 初识sele ...

  7. golang学习之select用法

    早期的select函数是用来监控一系列的文件句柄,一旦其中一个文件句柄发生IO操作,该select调用就会被返回.golang在语言级别直接支持select,用于处理异步IO问题. select用法同 ...

  8. 数据库Oracle的select用法(部分)

    Oracle的select用法(部分): 1.查询所有: select * from employees; 2.加上where子句:用选择限制行 select * from employees whe ...

  9. <自动化测试>之<selenium API 用法2>

    不知道之前的selenium API 用法1,有没有去练习, 个人认为线性代码还是要靠敲的, 后面的模块化除了多敲还需要一定的编程思想去理解, 今天下午不是很忙就给来这儿补充点selenium api ...

随机推荐

  1. Struts2监听Action结果的监听器

    作者:禅楼望月 在前面我们学到了在特定的Action中配置结果监听器,在Action完成控制处理之后,struts2转入实际的物理视图之前被回调.但是这种方式的缺点是,结果的监听器不能被复用.根据设计 ...

  2. delphi保存文件的命名规则

    没有固定的标准.自己可以定义 .你可以参考PASCAL命名法则.查一下PASCAL命名. 我习惯用UMain,FMain,UDM,DM,UAboutBox,AboutBox.....程序相关内容都放在 ...

  3. ES索引

    Elasticsearch索引别名.Filtered索引别名.Template 在使用elasticsearch的时候,经常会遇到需要淘汰掉历史数据的场景. 为了方便数据淘汰,并使得数据管理更加灵活, ...

  4. SMT(SF)

    示例一: uint iPwmDuty; double temp; temp = (double)AdConvert(AN_TEMPERATURE); temp = temp/; iPwmDuty = ...

  5. error C3872: '0x3000': this character is not allowed in an identifier 解决方法

    文章参考地址:http://blog.csdn.net/danxuezx/article/details/5096497 编译时遇到这个错误多半是从网上拷贝一段代码到VS里然后编译时产生的,这是因为拷 ...

  6. HDU 1556 线段树/树状数组/区间更新姿势 三种方法处理

    Color the ball Time Limit: 9000/3000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  7. hadoop 架构

  8. 「6月雅礼集训 2017 Day2」C

    [题目大意] 有一棵n个点的完全二叉树,边权均为1,每个点有小鸟容量c[i] 依次来了m只小鸟,第i只小鸟初始位置在pos[i]上,问来了x只小鸟的时候,怎样安排小鸟的路线可以使得小鸟移动的边权和最小 ...

  9. git分支开发,分支(feature)同步主干(master)代码,以及最终分支合并到主干的操作流程

    由于rebase执行速度慢,分支同步主干代码时,分支的每次提交都可能和主干产生冲突,需要解决的次数太多,影响提交效率. 同时,为了保证主干提交线干净(可以安全回溯),所以采用下面所说的merge法. ...

  10. 关于jQuery.extend

    这次来了解下jQuery的extend吧,作为菜鸟的我学艺不精,看插件时经常看到extend函数的使用,从网上看到一篇不错的介绍,特地转载过来留给自己收藏学习: ------------------- ...