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

  • 相关阅读:
    NET Core-TagHelper实现分页标签
    NET Core-学习笔记(三)
    NET Core-学习笔记(二)
    NET Core-学习笔记(一)
    MVC默认路由实现分页-PagerExtend.dll
    Tomcat优化
    JVM参数配置大全
    tomcat8+memcached session共享
    Tomcat+Nginx+Redis+MySQL实现反向代理、负载均衡、session共享
    搭建Tomcat应用服务器、tomcat虚拟主机及Tomcat多实例部署
  • 原文地址:https://www.cnblogs.com/breakcircle/p/6282488.html
Copyright © 2011-2022 走看看