One feature of Selenium, which distinguishes it from "traditional" means of automation of functional testing at the UI level, is that Selenium does not have its selection of the IDE. This is partly due to the fact that Selenium-RC is a server that executes the command + client library, ported to a programming language. Accordingly, tests have already written in the environment, which is determined by the programming language.
Such a variation in the means employed implies the absence of built in IDE various generators, wizards, which could simplify the writing tests. Nevertheless, there are a number of tasks that have to be decided on a regular basis. The selection of locator is a fairly common problem. Because there is no dedicated IDE then in such problems the other instruments come to help us. So, what tools can make life easier.
The most convenient for the development is currently Firefox browser. Firstly, it is better for the proxy, and secondly, due to the possibility of creating an individual profile, we can fix a variety of settings, including preservation of specific file without the dialog.
But the main strength of the browser is in its plug-ins. In particular, the Selenium IDE is actually a plug-in for Firefox. Therefore, the first step after downloading the basic components of Selenium-a (the server and client libraries), it is recommended to install Selenium IDE. Than it will help us:
- At this point it is almost the only more or less common tool for record&playback tests for Selenium. At least it helps to determine what acts are done.
- In the dialog Selenium IDE there is the functional location of elements on the page. When you select a row in a field that contains the commands it is activate the fields Command, Locator, Parameter.
- This product contains the possibility of generating code of written test on the selected programming language
As already noted, one of the major challenges is a selection of locator. Often, to solve this problem have to pick your HTML-code of the page. But if the code is generated on the server or the number of elements generated by the client script, this task will be difficult because of the ponderous code or JScript designs that do not reflect the current status of the document structure. But all this can be viewed through another plug-in for Firefox: Firebug.
This plug-in allows you to view the DOM-structure of the current page, including dynamically generated content.
In addition, another plug-in can help you: XPath Checker. Since XPath-locators are hardly the most universal, this plug-in will let you get exactly the XPath of the selected item. To do this, just click right mouse button on the desired item in the drop-down menu and select View XPath. But note that this tool finds XPath using common algorithms that can be not optimized for your needs. Therefore, locator obtained by this tool is better to optimize.
Despite the fact that Firefox is most convenient for test development Selenium, other browsers are not deprived of aids. In particular, the Internet Explorer available such plugins as:
- IE Developer toolbar
- Http Watch
- FireBug Lite
You can also find a number of other tools to assist in the development. All these above are often used. But most important to set these tools in advance to make it easy to solve problems that arise in the development of Selenium-tests.