• 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. Intellij IDEA将工程打包成jar包并执行

    打开File -> Project Structure -> Artifacts 点击“+”,选择“Jar”,选择Empty或From modules with dependencies, ...

  2. group by 分组后 返回的是一个同属性的集合

    group by 分组后 返回的是一个同属性的集合  我们可以遍历该集合

  3. Beats数据采集

    Beats数据采集 Beats是elastic公司的一款轻量级数据采集产品,它包含了几个子产品: packetbeat(用于监控网络流量). filebeat(用于监听日志数据,可以替代logstas ...

  4. JVM GC Q&A(补充ing)

    1.如果一个对象没有与其相连的GC ROOT,一定会被回收吗? 这个对象并非是非死不可的,这时他只是处于死缓阶段,要真正宣告一个对象的死亡,至少要经历两次标记过程:如果对象在进行可达性分析后发现并没有 ...

  5. C#重载和重写

    Overload:重载就是在同一个类中,方法名相同,参数列表不同.参数列表不同包括:参数的个数不同,参数类型不同. using System; using System.Collections.Gen ...

  6. 【题解】JLOI2013卡牌游戏

    这题最开始是用 \(n^{4}\)的算法水过的,之后才想出的\(n^{3}\)正解.首先,\(n^{4}\) 应该是很容易想到的:设状态 \(f[i][j][k]\) 为有 \(i\) 个人,庄家为 ...

  7. 用JavaScript写一个类似PHP print_r的函数

    PHP print_r的函数很好用,可以用来打印数组.对象等的结构与数据,可惜JavaScript并没有原生提供类似的函数.不过我们可以试着自己来实现这个函数,下面提供一些方法与思路. 方法一 fun ...

  8. MySQL 数据库性能优化之缓存参数优化

    在平时被问及最多的问题就是关于 MySQL 数据库性能优化方面的问题,所以最近打算写一个MySQL数据库性能优化方面的系列文章,希望对初中级 MySQL DBA 以及其他对 MySQL 性能优化感兴趣 ...

  9. 开发中常遇到的Python陷阱和注意点

    最近使用Python的过程中遇到了一些坑,例如用datetime.datetime.now()这个可变对象作为函数的默认参数,模块循环依赖等等. 在此记录一下,方便以后查询和补充. 避免可变对象作为默 ...

  10. [BZOJ1441&BZOJ2257&BZOJ2299]裴蜀定理

    裴蜀定理 对于整系数方程ax+by=m,设d =(a,b) 方程有整数解当且仅当d|m 这个定理实际上在之前学习拓展欧几里得解不定方程的时候就已经运用到 拓展到多元的方程一样适用 BZOJ1441 给 ...