Selenium is an open source web application Test Automation tool. Learning Selenium is very easy. Anybody who worked on manual testing can easily learn Selenium. We will try to explore how to learn Selenium Step by Step.
Selenium has three main tools – Selenium IDE, Selenium RC, and Selenium Grid.
First let us have a look at Selenium IDE
Selenium IDE – This is a Firefox Add-on (download from openqa download page). Download Selenium IDE and install.
Once the IDE is installed, go to tools – > click Selenium IDE. This opens up the Selenium IDE as below:
Once this is done, close the Selenium IDE.
Now let us record a test:
- Open a new browser
- Navigate to www.google.com
- Click tools – > Selenium IDE (opens up IDE)
- click on Advanced Search link on Google search page
- type “selftechy” in “all these words:” edit box
- Select “20 results” from “Results per page” drop down
- Click Advanced Search button
- Click on File (on Selenium IDE) – > Save Test Case As and then give it a name and save the test case
Selenium IDE has recorded around 3-4 test steps. Starting from the first step – > right click on each step and then click “Execute this command”. Execute all the commands one by one.
Try to record some more tests with even more complexity and also record more number of tests. Then try to execute each tests as explained above. By this way you can become more comfortable with Selenium IDE. After this exercise we can go ahead and try to learn exporting the tests in different formats such as Java, JUnit, PHP, C#, etc and also setting up the Selenium RC with Eclipse.
Below are the drawbacks of using Selenium IDE for record and execute tests:
- If all the test steps are executed together then the chances of tests getting failed is more because of page load time / objects taking more time to appear on the web page
- Parameterization is difficult and values should be hard coded
- Maintenance is much more difficult, etc.
I have explained using Selenium RC and configuring Eclipse with Selenium RC in my earlier post – Setting up Selenium with Eclipse
For detailed configurations have a look at the above post.