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.
- Download SelBlocks Add-on in your Firefox browser.
- Record a basic Google search scenario in Selenium IDE.
- Now, create an XML file with the following content. These test data will be used as Google search keyword.
12345<testdata><vars keyword="Manual Testing" /><vars keyword="Automation Testing" /><vars keyword="Performance Testing" /></testdata> - 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.
- Replace the search keyword with variable in test data file. You can do this by using ‘${YOUR_VARIABLE}’ syntax.
- End the test script by adding ‘endForXml’ command. This denotes end of Selenium IDE data driven functionality.
- After performing all steps above, your Selenium IDE script should resemble below image.
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.
what??? you did not show me how to data drive? I will give you 0 stars as rating
nevermind I did not read the full post