Yesterday I practiced using CSS (that is, cascading style sheets cascading Stylesheet) Selector to locate the elements (Elements) on the (locate) page. The document in Selenium's official website strongly recommends using CSS Locator instead of XPath to locate elements, because CSS locator is faster than XPath locator,
Yesterday I practiced using CSS (that is, cascading style sheets cascading Stylesheet) Selector to locate the elements (Elements) on the (locate) page. The document in Selenium's official website strongly recommends using CSS Locator instead of XPath to locate elements, because CSS locator is faster than XPath locator,
What is CSS Selector?CSS selector positioning is actually the HTML CSS selector tag positioningToolsCSS selector can be downloaded using Firefox plugins, Firefinder or Firebug and firep
: property value; Property Name: property value;... ... ...} } }/* Apply to Page 4. Wildcard selector:* {//Wildcard selectors are used for all styles, most of which are used to define the initialization of all internal and external margins, but with the lowest priorityProperty Name: Property value;//usually some experienced web front-end engineers habitually zeroed out margins...//margin:0px; paddin
First, what is CSS SelectorCSS selector positioning is actually the HTML CSS selector tag positioningToolsCss Selector's exercises suggest that you install Firefox, download plugins, Firefinder or Firebug and firepath combinations.Second, Css
child elements for span, matching to the first one.: The First-of-type matches the P elementTherefore, through the above two examples can draw a conclusion:: First-child matches the first child element of a parent element, which can be said to be the first child of a structure.: First-of-type matches the first of the
what is CSS Selector? CSS selector positioning is actually the HTML CSS selector tag positioningToolsCss selector exercises suggest using Firefox, download plugins, Firefinder, FireBug,
(1) Parent-child selector can have multi-level, but the actual application does not recommend too much, not more than three layers.
(2) The parent-child selector has a strict hierarchical relationship.
(3) A parent-child selector
TR td:nth-child (2) { background-color:Gray;}is the second TD attribute of TD in Tr.tr:nth-child (2n+0) { background-color:#F0F0F0;}This is a multiple of TR's 2.Use the formula (an + b). Description: Indicates the length of the period, N is the counter (starting at 0), and B is the offset value.Here, we specify the background color of all p elements that have a multiple of 3 in the subscript:p:nth-
For the following reasons, please troubleshoot:Cause 1:xpath at the specified location is not shown, automation has been clicked, so that the element can not be found, the solution is to join the waiting time, Thread.Sleep (3000), the above is 3 seconds.Cause 2:xpath The specified position is affected by the front and back, such as need to click on the other content before it can be displayed, so need to deal with.Suggestions:XPath positioning suggests using relative path positioning, which you
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.