Selenium IDE Tutorial – Part 1

Selenium IDE is an integrated development environment for performing Selenium tests.  Selenium tests can be written as HTML tables or coded in various languages like C#, PHP, Perl, Python and can be run directly in most modern browsers.The IDE can help you to record, edit and debug tests. Currently the IDE is only available for Firefox (as if we developers will use any other) as a addon.

Here is a possible scenario for using Selenium. Imagine you have created a HTML form with about twenty fields and you have to repeatedly test the form. Filling the form every time can quickly become tedious. With Selenium you can automate the whole process and run the test as required. In this part we will see how to create a simple test in Selenium. So let’s get started.

STEP 1 – installation :

You can download Selenium IDE from this locations.
Once the addon is installed make sure you do not forget to restart Firefox.

STEP 2 – running a simple test :

a. Start Selenium IDE  in Firefox: Tools->Selenium IDE. You will see the following popup.


b. Click on the red record button on the right.
c. Browse to and enter ‘selenium’ in the search box and click enter.
d. Click on the first result, which is that of
e. Stop the recording by clicking on the record button.

You should see something like below. If you click on the ‘ Source’ tab you can see the test html generated by selenium.

selenium ide

The ‘table’ tab shows the commands recorded by Selenium.

f. Open a new tab in Firefox and click on the Selenium IDE’s play button to run the recorded test.

selenium ide

The IDE should play your recorded test. After the test is complete you should have landed on the selenium page ( The IDE after the test run is shown below. In the ‘Log section’ you can see the various events run by the test. In the table tab you can see that all the rows are green, which means that the test ran successfully.

selenium test run

Now lets add a small assertion to the above test.

a. Click on the blank line below after the last ‘clickAndWait’ command and insert ‘assertTextPresent’ command from the drop down box as shown below. You should see something like this.

This test checks to see if the text ‘Selenium News’ is present in the last rendered page. Run the test again and you should see that the test has run successfully. No try replacing the text with something that is not present on the page, take for example ‘elvis’ and run the test again. Now the test fails and you should get the screen below.

You have just completed your first test run. And it was so simple.

‘assertTextPresent’ is one of the hundreds of commands available for your testing needs. Just browse throught the command drop down to get a feel of what you can you get.

In the next part we will see more advanced features of Selenium.

62 thoughts to “Selenium IDE Tutorial – Part 1”

  1. Hello Sameer
    New to this but will learn, reading all kind of info, but seems you are the Master.
    My problem is on the site i am testing navigation header has a link to a pdf when i click on the pdf it opens but selenium gives an error

    [warn] Link has target ‘_blank’, which is not supported in Selenium! Randomizing target to be: selenium_blank18660

    when the pdf opens in another window a new browser window opens untitled

    i tried to insert a go back with link but still no luck, can you please help

    [warn] Link has target ‘_blank’, which is not supported in Selenium! Randomizing target to be: selenium_blank18660

  2. sameer

    Thank you so much that did the trick, now i have another issue, i saw it on the google selenium users but no answer.

    I was able to open the pdf page with no error but now i am trying to close it and go back to the original page

    I did a



    and got this error


    What am i doing wrong.


  3. Hello sameer

    i read my own post and made no sense at all, sorry Sir.
    My problem is now i am trying to close the pdf’s i opened and hace use close or windowselect and i am still getting errors.

    this is where i am

    Focus euro stage

    Focus euro stage







  4. I have downloaded and installed the latest Selenium IDE dated March 26, 2010. However, when I start using it, the “Table” tab is disabled and the other functions are ALSO disabled. The only option available is the “Record” icon.

    Is there something wrong or did I install it incorrectly?

  5. Hello Sameer

    I have been trying to close 2 pop up windows and i am having trouble identifying them in order to close them , can you please help. Thanks


    Vyvanse® (lisdexamfetamine dimesylate) CII Patient Support







    this is the error i a am getting and i have not been able to figure out how to close the 2 pop up windows that are in the format of PDF

    * [info] Executing: |open | | |
    * [info] Executing: |assertTitle | Vyvanse® (lisdexamfetamine dimesylate) CII Patient Support | |
    * [info] Executing: |openWindow | | |
    * [info] Executing: |selectWindow | | |

    * [error] Could not find window with title

  6. Hello Ed!
    Sorry for replying so late. Instead of opening the pdf’s with ‘openWindow’, use Javascript to open the pdf’s with the ‘’ method, passing a window name, say ‘mywindow’. Assuming that link name is ‘pdf1’, the following should work.

    A example is posted here.

    Check the source to get the idea.

    The Selenium test case for the above link is here:

    Note there will a 30 second delay after the ‘waitForPopUp’ command.

  7. Hi Sameer,

    The IDE does not play the recorded flow.Please help me in this regards.

    Thanks in advance.

Comments are closed.