Locators are the way to tell Selenium with which web element we like to do something (It can be anything, like:
Selenium provides different ways of locating those web elements; we call this the locating strategy. In Selenium we can locate web elements by CSS, XPath, Name, Id, and even Link text. We have to define the locators our self, so we have full control over it.
The CSS locating strategy is recommended for three reasons:
- It’s faster;
- It’s more readable;
- It’s more used.
Before we start working through this chapter we need to make sure that Mozilla Firefox is installed on the machine with the Firebug add-on. If you do not have Mozilla Firefox installed, you will need to download it from http://www.getfirefox.com/ . Once Mozilla Firefox is installed, you can start downloading the Firebug add-on from http://getfirebug.com/ .