Selenium CSS Selector #6 – Next Sibling | Adjacent Sibling Combinator

Adjacent sibling combinator (+) separates two CSS selectors and matches the second webelement only if it immediately follows the first webelement, and both are the child of same parent webelement.

Next Sibling elements are located using the + operator.

Selenium CSS Selector #7 – First-Child, Last-Child, Nth-Child, Nth-Last-Child

In this Selenium CSS Selector tutorial we will learn about CSS Selector Pseudo classes first-child, last-child, nth-child and nth-last-child.

A CSS pseudo-class is a keyword added to a selector that specifies a special state of the selected web-element

first-child – Returns first element from the group of sibling elements

last-child – Returns last element from the group of sibling elements

nth-child() – Returns elements based on their position in a group of siblings nth-last-child() – Returns elements based on their position among a group of siblings, counting from the end.

Selenium CSS Selector #8 – First-of-type, Last-of-type, Nth-of-type()

In this Selenium CSS Selector tutorial we will learn about CSS selector Pseudo classes first-of-type, last-of-type and nth-of-type()

first-of-type – Returns the first element of its type among a group of sibling elements

last-of-type – Returns the last element of its type among a group of sibling elements

nth-of-type() – matches elements of a given type, based on their position among a group of siblings.