Tuesday, October 20, 2009

Part 7: Beginners How to Start With??

If you are new to selenium and going through these posts you will be thinking Selenium RC is good and powerful and I am proficeient in my favourite programming language so I should start with Selenium RC. But the answer is NO, you should start with SElenium IDE to know about the selenium Commands and actions.

1. Download Selenium IDE using Firefox (Tools-->Add-ons)
2. After doing that click on Tools you will see Selenium IDE there.
3. Click on Selenium IDE
4. ByDefault selenium IDE with open with HTML as format.
5. If you want to chnage the format go to Options-->Format and choose the format you want.
6. Now click on File --> New Test Case whcih effectively create a new test case, click on the record button from the toolbar (right most)
7. Enter the base url of your application in the Base URL TextField. Do soem actions on the application under test and you can see that the selenium IDE records the action you do.
8. Now click on the "play current test case button" and verify that the test executed currectly.
9. We can view the log in the lower pane of the Selenium IDE window.
10. Now you can save the test and re-open and run it again.

(Seleniums wait methods wait for pre-defined milli seconds bydefault it will be "30000" you can change this by going to Options-->options-->Default value for recorded command)

More importantly give special attention to the middle pane of the selenium IDE window. Where we will see the Command, Target and Value

Command is the Selenium Command/Method to be executed
Target is on what field command should be executed (Target is nothing but locator)
Value is the input value of the field (for Text, DropDown, etc)

So to get good control over selenium you should check the auto help option from Command Filed" Type any character in the command Field Selenium IDE will list the commands starts with that character. Now select any of the listed command, If you look at the bottom pane we can see that the pane is changed to References and it displays the description the selected Command.

Work and play with the IDE commands and be ready by yourselves to move to the next level

No comments:

Post a Comment