Webinar: Delivering Applications in the Pink of Health with End-to-End Test Automation Register Now
<< Blog

Data Driven Testing Made Easy – Selenium vs. TestingWhiz

Monday May 27, 2013

If you talk to Test Automation Engineers, there are some basic features they are looking for when deciding for a Test Automation tool like Framework Implementation, Data Driven capability, Record and Playback, Object Identifier, etc. Most of the tools available in the market today possess almost all of these capabilities.

So, which tool I should select for Data Driven Testing? First thing I would consider is: functionality and ease of use. How do you measure the ease of use for a particular feature? Let’s take a case of Selenium vs. TestingWhiz in terms of functionality and ease of use.

Getting started with selenium is easy, but when you want to implement data driven testing with selenium it gets a little tricky. You have to be a good programmer to write the code that fetches the data from excel sheet or CSV file. For getting the data from the database, you have to have proper JDBC connection mapped with the database of your choice. Here is a code snippet for including data driven testing through Selenium:

DataSet ds = getExcelData(); if (ds != null) { if (ds.Tables.Count > 0) { foreach (DataRow dr in ds.Tables[0].Rows) { String searchtext = Convert.ToString(dr[0]); driver.get(baseUrl + "www.google.com"); driver.findElement(By.id("gbqfq")).clear(); driver.findElement(By.id("gbqfq")).sendKeys(searchtext); driver.findElement(By.id("gbqfb")).click(); }}} private DataSet getExcelData() { string connString = "Provider=Microsoft.Jet.OleDb.4.0;" + "data source=C:\\Test.xls;" + "Extended Properties=Excel 8.0;"; OleDbConnection oledbConn = new OleDbConnection(connString); DataSet ds = new DataSet(); try { oledbConn.Open(); OleDbCommand cmd = new OleDbCommand("SELECT * FROM [Sheet1$]", oledbConn); OleDbDataAdapter oleda = new OleDbDataAdapter(); oleda.SelectCommand = cmd; oleda.Fill(ds); } catch { } finally { oledbConn.Close(); } return ds; }

We can say that it requires fair bit of coding.

Now let’s go through the data driven testing automation tool, TestingWhiz. In TestingWhiz, there are 3 options to make your test script data driven:

  • Manual Entries in the Data table

  • Import from Excel sheet or CSV file

  • Fetch the data from Database (Any of MS SQL Server, Oracle, MySQL, IBM DB2)

For choosing any of these options, a tester doesn’t require any coding knowledge. Data table is included by default with any test script in TestingWhiz. Here is a snapshot of inserting the data manually:

Inserting Data Manually

Generally for a testing team, the data may also be included in the excel sheets or as part of CSV files. Importing that also is very easy with TestingWhiz as you can see below:

importing data from TestingWhiz

It gives an option to select the columns and rows to be imported and that becomes easy from tester’s perspective.

For an enterprise application, tester may have created another script that reads the data directly from the database. With TestingWhiz, a tester doesn’t need to create any script. If the database is configured in this automated software testing tool, a tester can write simple or complex queries to fetch the data and store in placeholder to be utilized as part of the test script:

database fetch and export

Add caption

After this comparison, as a tester I can say that TestingWhiz is easy to use in terms of automated data driven testing and it also provides more options for importing the data as well as its code free in comparison to Selenium. Though there is limited support in TestingWhiz in terms of Databases supported (Only MS SQL Server, Oracle, MySQL and IBM DB2 are supported), but for people using any of these databases, TestingWhiz provides more flexibility.

To perform Automated Data Driven Testing for your applications, Download TestingWhiz now!


TestingWhiz is committed to providing innovative, automated software testing solution to global enterprises and software companies for their web, mobile and cloud applications.


Mack-Cali Centre III,
140 East Ridgewood Avenue
Suite 415 ST, Paramus,
NJ 07652, USA