Selenium-css Selector How to use

Source: Internet
Author: User

What is CSS Selector?

CSS selector positioning is actually the HTML CSS selector tag positioning

Tools

CSS selector can be downloaded using Firefox plugins, Firefinder or Firebug and firepath combinations.

How to use:

1. CSS Selector support ID, class positioning is the same as CSS positioning in HTML

" Navi "  class "inner  "  C1 C2 c3"  -c1.c2.c3

2. CSS selector supports arbitrary attribute positioning

[Name="name"]

3. CSS selector provides tag attribute combination positioning

Input[name="name"]

Easier to write when combined with ID, Class

Class->input.c1id    ->input#i1
4. CSS Selector provides multi-attribute combination filtering
Select [size='4'] [multiple='multiple']
5. CSS Selector supports hierarchical relationship positioning
div.inner>inputselect>option[value='3']

6. Css Selector Fuzzy Matching

start with xx [placeholder^=' please pass ID'] to end with XX [placeholder$='  ID anchor element '] contains xx[placeholder*='ID'

Advantages: CSS selector syntax is relatively concise and runs faster.

Disadvantage: index positioning is not supported

Summary: writing UI Automation takes precedence over CSS Selector selectors and cannot be used with XPath selectors.

Selenium-css Selector How to use

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.