First, what is CSS Selector
CSS selector positioning is actually the HTML CSS selector tag positioning
Tools
Css Selector's exercises suggest that you install Firefox, download plugins, Firefinder or Firebug and firepath combinations.
Second, Css selector use method
1, through the ID, class positioning
1 ID Locator 2 #号代表id, it is more concise to locate the label with ID 3 #i1 4 5 class positioning 6 . Represents class 7 . C1 8 class positioning also provides multiple class positioning, through continuous. To narrow the range 9 . c1.c2.c3
2, through the label positioning
1 Positioning method: Directly enter the label name 2 Div 3 input 4 alone with no effect, because a page the same label too much, need and other ways together with
3, through the property positioning
12 [name= ' N1 ']
4. Positioning by combination of tag attributes
1 Tag Attribute combination 2 input[name= ' N1 '] 3 4 tag and class combination 5 Input.c1 6 7 combination of tag and ID 8 Input#i1
5. Through multi-attribute combination
1 CSS Selector Multi-attribute combination selection filter without and only requires multiple [] connections to 2 select[name= ' City '][size= ' 4 '][multiple= "multiple"]
6, through the hierarchical relationship positioning
1 different Css selector with XPath to differentiate hierarchy by > 2 select>option[value= ' 3 ']
7. Fuzzy Matching
1 ^= match element properties start with what 2 [placeholder^= ' Please enter '] 3 4 $= What does the match attribute end with? 5 [placeholder$= ' element '] 6 7 *= Match property contains what value input 8 [placeholder*= ' ID ']
How to use the ==>css selector of selenium learning