Wednesday, March 25, 2015

How to use Selenium IDE?!

To start with you need to install the needed IDE.
You can refer to How to install Selenium IDE for more information.

This is very useful to automate user actions on a website, automate certain web administration actions, to automate bug reports, create automated test scripts that shows the bug report and attach that script i your bug report so that the developer can view it and see the flow
  • Open Firefox
  • Click Tools and click Selenium IDE
  • Selenium IDE will open
Now I will show you some simple steps how to work with Selenium.

How to Record a test flow?
  • When you open the IDE move the corser to the Red button. There you will see 'Now Recording. Click to Stop Recording'
    This means you are ready record.
  • Now you can load the web page you want to test and start recording the steps of the flow you want to execute.

    What I'll be doing is search Kala's World :) in Google and view How to install Selenium IDE?! post! For that I am doing the following steps.
  • When you do each of the above steps it will get recorded automatically in the Selenium IDE, one step at a time.
  • Click the Red button to stop recording
  • Save the Test Case (File > Save As > Give a file name > Click Save)
  • In the Table section you can see the saved steps
  • The Reference tab gives you the information what those commands in each step do
  • The Command column basically shows what action needs to be performed when testing
  • Target column shows where exactly that action has to be perform in the web site 
  • The Value column shows the value needs to be given to execute the command or some additional information. 
  • Selenium IDE saves the test cases as HTML. You can view it by clicking the Source section


    How to Run a recorded test case/suit?


  • Now lets run the recorded steps.
  • You can Click 'Play entire test suit' / 'Play current test case' button to run the whole flow.
  • Or click each and every step to run one step at a time.
  • There is a slider Fast Slow to adjust the speed of the execution if you want to look in to the steps more clearly. 
  • When you run you will see how it is been executed from the Log tab


  • Now let's see how this gives an error if there is a wrong step included.
I am going to edit the 3rd step click.
  • Click on the step
  • Go to the Target field change the name=btnG to name=btn  The step will be changed.
  • Now execute the test case again.
  • This test should get failed giving the bellow error in the Log tab.

How to stop the test from a particular step?
  • Right click on the step you want to stop the test run.
  • Select Toggle Breakpoint.


  • Now the execution should stop above the step you put the break point.
  • And if you want to move forward from that point onwards click Pause/Resume button. Then the remaining steps will be executed.
  • If you want to run through the steps after the break point one by one you can click Step button and execute the steps.


How to add more steps to the test case?
  • Go to the end of the test case.
  • Click on the empty space. 
  • Click the Record button.
  • Now you can add more steps as you want and save.
  • And if you want to add a step to the middle. Right click > Insert New Command
  • You can manually write the command without recording.
  • For that Right Click on the empty space and select 'Insert New Command'
  •  Now you can enter the values you need in the Command, Target, Value fields and add a new step to the test case.


  • And if you need help in adding the values to the Target field you can always go to the next step location from your browser.
    Right click and select 'Inspect Element'
  • It will show you the information needed about the field, drop down list ..etc.
    You can always use the 'id=' to identify the place you want.


How to enhance the test case by adding documentation?
This helps a user to understand what we do in the test case or may be we can divide the test case in to sections for our benefit or future reference.

  • Click on the place where you need to add a comment. Right Click > Insert New Comment
  • Now you can add you comments to make it more simple.
  • Save after doing the changes.


Hope you got the basic idea how you can use the Selenium IDE! Enjoy the work!


No comments:

Post a Comment