zoukankan      html  css  js  c++  java
  • [Selenium] The most commonly used CSSSelector

    CSSSelector

    Example

    Description

    element.element

    div.dropdown

    Select all  <div> elements whose class=“dropdown”

    element#element

    div#new-input

    Select all <div> elements whose id =“new-input”

    element element

    div p

    Select all <p> elements who are under <div> element

    element>element

    div>p

    Select all <p> elements whose father is <div> element

    [attribute]

    div[rowid]

    Select all <div> elements who has attribute rowid

    [attribute=value]

    input[value='OK']

    Select all <input> elements whose attribute value is ‘OK’

    [attribute*=value]

    a[src*=‘abc’]

    Select all <a> elements whose attribute src contains  ‘abc’

    :nth-child(n)

    p:nth-child(2)

    Select all <p> elements who is the second child of its  father

    eg 1:  div.rtq-grid-row[rowid]  div.rtq-grid-cell:nth-child(5)  a

    eg 2: div#fileUpDiv  input[value='OK']

  • 相关阅读:
    布局管理
    菜单和工具栏
    Hello World,本章学习Qt的基本功能
    PyQt5中文手册
    qemu-kvm使用
    查看内核日志
    tmux快捷键
    vim插件YouCompleteMe安装
    git submodule删除多余模块
    vim ctags
  • 原文地址:https://www.cnblogs.com/feifeidxl/p/4450511.html
Copyright © 2011-2022 走看看