In this tutorial we will cover RSpec WebDriver CssSelector Tutorial. CssSelector works very similarly to XPath and Locators but the main difference is that unlike XPath and Locators which look at the HTML source code for a given web page, CssSelector looks at the cascading style sheets for a given web page.
RSpec WebDriver CssSelector Video Tutorial
CssSelector is subject to the same type of weakness as XPath is. For XPath if the structure of the web pages changes then your paths for xpath may break in your tests. The same can be said for cascading style sheets i.e. is the style sheets change then your tests may also start to fail as a direct result.