Using Drupal AND Selenium for data driven testing

This may sound a bit strange to many of you ... but, we have engineered a way to create a framework for managing scheduled selenium launches, and providing data into each launch (data driven) using a Content Management System (Drupal). For  our needs, we needed the ability to have a separation between data and the scripts themselves. I should menton that we are a performance engineering team;although, this method has also been used for functional testing. We were looking for browser-based (not synthetic) single instance performance testing metrics.


How to write data to a database

Attached are two files used as an example of how to write data to a MySQL database using HTML/PHP.


Place these two files inside the document root and call the results.html file. Fill out the form data and hit submit. It will call the insert.php file which will make a database call to the Results database and make the insert to the 'results" table. Simple, and avoids Drupals 30-120 database calls just to load its pages.


Data driven testing with the IDE

This article demonstrates one way to achieve real-time, complex data-driven testing with the Selenium IDE. Yeah, you heard me; real-time, complex data-driven testing with the Selenium IDE. When I say real-time, I mean queried data, not data stored in an XML or CSV file (or any other static data method that has to be refreshed to be considered real-time and valid).

For this scenario, let's make a few assumptions that I believe are actually typical to most companies: