zoukankan      html  css  js  c++  java
  • selenium Select用法笔记

    • 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

  • 相关阅读:
    公司上线流程 pushonline_alpha
    关于统计数据
    实习生新手指南1
    菜鸟代码学习散点总结(四)
    菜鸟机器学习散点总结(三)
    菜鸟机器学习散点总结(二)
    springboot 中事件监听模型的一种实现
    java 代码获取视频时长
    spring cloud 服务链路追踪 skywalking 6.1
    windows 中如何定位恶意软件的藏身位置
  • 原文地址:https://www.cnblogs.com/breakcircle/p/6282488.html
Copyright © 2011-2022 走看看