Time for action - finding elements by CSS
So finding Elements by XPath can be an extremely costly exercise. A way around this is to use CSS selectors to find the objects that you need. Selenium is compatible with CSS 1.0, CSS 2.0, and CSS 3.0 selectors. There are a number of items that are supported such as namespace in CSS 3.0 and some pseudo classes and pseudo elements.
The syntax of your locator will look like
css=cssSelector. Let's create our first selector to find an element on our page.
- Open the Selenium IDE.
- Open Firebug and click on the Firefinder tab.
- We are going to look at one of the buttons in the div with the ID
divontheleft. The CSS Selector for the buttons would be
div.leftdiv input. Place that into Firefinder and click on the Filter ...