Implementing Selenium IDE Data Driven Testing

During test automation activities in our projects, we often come across a requirement to make our test scripts data-driven. We can do this by writing a custom code for Selenium WebDriver. But that would be of much overhead for basic data-driven functionality. Selenium IDE can be used to keep things in minimum in that case. So, this tutorial explains how we can implement Selenium IDE data driven functionality.

SelBlocks is a Firefox Add-on which can be used to perform basic data driven functionality in Selenium IDE. We will use Google search scenario as an example to implement Selenium IDE data driven functionality.

  1. Download SelBlocks Add-on in your Firefox browser.
  2. Record a basic Google search scenario in Selenium IDE.
  3. Now, create an XML file with the following content. These test data will be used as Google search keyword.
  4. Add ‘forXml’ command in your Selenium IDE script with target set to the XML file’s path. forXml command is provided by SelBlocks to refer XML test data file.
  5. Replace the search keyword with variable in test data file. You can do this by using ‘${YOUR_VARIABLE}’ syntax.
  6. End the test script by adding ‘endForXml’ command. This denotes end of Selenium IDE data driven functionality.
  7. After performing all steps above, your Selenium IDE script should resemble below image.

    Selenium IDE Data Driven Test script

    Selenium IDE Data Driven Test script

As you can derive from above tutorial, it is relatively easy to implement data driven testing in Selenium IDE. And it would be more efficient to implement Selenium IDE data driven functionality for basic automation tasks than to write a custom code in Selenium WebDriver.  This will ensure simplicity in your test automation activities. Let us know your inputs about it in the comments section below.

Comments
  1. sas
  2. sasdsa

Leave a Reply

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