How To Write Your First Selenium Testing Script With Selenium IDE

Today i will show you how to use Selenium IDE to write your first Selenium testing script. If you do not know what is selenium IDE and how to add it into your Firefox web browser, you can read following article first. How To Install Selenium IDE And Firebug In Firefox

You need 3 steps to write selenium testing script use that IDE. That is Record, Play Back and Save.

Record: Record interactions between user and the web browser.

Play Back: Run the recorded selenium testing script to check the test script’s success rate and stability.

Save: When the recorded selenium testing script is stable then save it for future regression test.

Step 1: Record Selenium Testing Script

  1. Open Firefox, Then Open Selenium IDE. You can click here to know how to open it.
    Firefox Menu —> Developer —> Selenium IDE
    Open Selenium IDE
  2. Enter www.yahoo.com in the base url input textbox. Make sure the red record button is on (default is on).
    Selenium IDE Record window
  3. Input the base url into your Firefox url address bar. Then you can begin test case step by step manually. (Do not close the IDE window.) You will see that the IDE will records every action you take in your Firefox web browser. When you complete your test case then all the actions has been recorded.
    Selenium IDE records actions when you run test case manually
  4. You can also right click web page in the Firefox web browser then select and add commands into the test scripts.
    Add Selenium IDE commands
  5. When you add one command you will see the command has been inserted into the test script in IDE window.
    selenium command inserted into selenium window
  6. When your test case complete, you should turn the red record button to off state.
    turn record button to off state
READ :   Selenium Overview

Step 2: Play back the recorded selenium testing script.

Now your first automation testing script has been created,  you can click playback button to run it.
play back Selenium IDE testing script

When your selenium testing script execute, all the successful selenium IDE recorded test steps will highlighted in green color while the failed test steps will highlighted in red color.
play back Selenium IDE testing script success test steps is green color

 

Step 3: Save the selenium testing script for later use like regression test.

Click “File —> Save Test Case” in Selenium IDE window to save the selenium testing script into a html format file. When you open the saved file you will see the html content.
selenium IDE save testing script

(Visited 331 times, 1 visits today)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.