Sometime back I analyzed selenium tool for testing the application from UI. Here are some notes which I created during the analysis
What is it: The Selenium is a web testing tool that promises to test any web application from UI. The tool has capabilities to record and play the test cases.
Downloadable: It provides two types of basic installations- IDE (for Firefox), RC- Remote Control (for all browsers).
How to use
Using Selenium with Firefox (FF): Using Selenium with FF is pure vanilla. The Selenium IDE can be simply installed with FF as a plug-in. This has capability to record and play the test cases. Go to any simple website (say google) with a small form (lets search for Kamalmeet)
Step1: Open the URL for webpage
Step2: Fill the form
Step3: Submit the form
Step4: Check for desired message (In this example with google, lets check if the desired website was listed. Selenium provides you various options; you can look for a text on the webpage to mark the test case as a success)
Once all the steps are done. Just stop the recording. A test case is ready. Now I can play this test case and all the above mentioned steps would execute automatically.
Using Record and Play technique, we can create much more complex test cases (say 10 forms or screens are involved). These test cases can saved and imported to any machine with FF. Additionally, the cases can be exported to languages like Java, Ruby, C#, Perl, PHP and Python.
1. The test cases can be created just by browsing through the application. Not even single line of coding required.
2. Test cases can be exported to multiple languages. For Java it means it gets imported as JUNIT test case. Now they can be run as standalone JUNIT test cases on any machine.
3. JUNIT test cases can be further modified by developers as per need.
1. The IDE is limited to Firefox
2. Did not get satisfactory results for dynamic contents. If text is changing dynamically at run time, the Selenium was not able to recognize. This might require more analysis.
3. Pop-ups: If the window has a pop up, say ok cancel button, the tool was not able to handle it smoothly. More analysis required here.
Using Selenium with Internet Explorer (IE): Using Selenium with IE is not as straight forward as it is with FF, still possible. We need to create test cases manually in this case and then execute.
One way to create test cases is as mentioned above, run the application in FF with Selenium IDE and export the test cases in Java.
Secondly we can actually create the test cases manually. This is as not very tough, but certainly more work than using tool with FF. We would need to understand the tool in more depth and figure out Java commands which it uses internally and then create appropriate test cases.