Here’s a handy little script for web developers / QA specialists who need to generate human-related data for use in testing software. This program lets you rapidly build custom test data including names, phone numbers, email addresses, states, provinces and random text of varying size. You may download the information as an excel spreadsheet or view it as HTML. And (naturally), it’s free.
I wrote this program for generating sample submissions for my Form Tools script. Very useful indeed!
This is so cool! I think I have a use for this now. I was looking for a simple data generator today and I think yours will help me.
Since I’m still working on my test cases I was wondering if you have or sell a program where by I could keep my data generator setup information. It would be great if I did not have to retype my test data conditions when my requirments change.
Thanks.
Hi glo,
Thanks for the comment! I’m afraid there’s no facility for saving your settings just yet, but it’s certainly something I’ve had on the list – so I appreciate the post.
Right now I’m just updating it to allow for minimal control over country-dependent country. Specifically, zip/postal/postcodes and state/province/county information for Canada, UK, US and the Netherlands. I should be finishing that off in the next day or two.
But I agree, saving your settings would be a very useful feature. I’m toying with the idea of designing it to store all your information in the query string, so you can just store setups in browser bookmarks.
Anyway, all the best –
Hi,
Great work on the tool generator. Just have a look at it. It would be great if the tool allows me to download the test data result in an Excel or a CSV file format. Do expect more feedbacks from me.
Cheers
Karthik
Hi Karthik,
Nice idea – csv would be a good addition. I’ll definitely add that in the near future. And actually, it does already support Excel. Just select the Excel option.
Enjoy!
VERY NICE!!
Tool is realy cool. But i cannot create the sql script with date. It’s not genarating. I think page is not opening.
Hmmm.. works okay for me. Do you mean the popup page doesn’t appear?
Also, are you sure you’re entering a “format code”? (just select one of the examples for that type for the format code to be auto-generated).
Fantastic! Well done, and extremely useful.
spend 10 minutes on creating a query then it reports that Column Names must be alphanumeric…no fucking kidding. I had letter names for all the columns…….
Wow. What a beautiful piece of work. In these times of stolen laptops and heightened security awareness it’s nice to know where I can go to get a customized set of expendable data. I currently do volunteer work with an organization which requires importing data from Microsoft Access into Excel. This effort is required because the database (as designed) is a bear to use. As a result data is being recreated in Word! Ouch! My effort is to bridge the gap with Excel until the database is configured more to the organizations needs.
Although the work is done in Excel, I’ll be using OpenOffice Calc at home because my computer is extremely allergic to Microsoft’s products.
This is a terrific idea. I’ve thrown together Perl scripts to do this sort of thing; however, they weren’t extensible and, as a result, were a headache to update whenever the output format needed to change.
There’s one additional feature that would make this usable for me: an auto-incrementing number starting at zero (or a specified number).
Also (someone already mentioned this), CSV output would be helpful.
Thanks – fantastic work.
Very useful indeed. Though there is still room for improvements:
1. “Number Range” should not insert these numbers as strings in MySQL:
Wrong: ‘1’,’2′,…
Correct: 1,2,…
2. Some suggestions for features:
a) add the default format for mysql to your date dropdown: `Y-m-d H:i:s`
b) what about being able to sort the output? I’d personally like to sort these inserts after the `date` column
c) more data types:
I. website (just take http://example.com as base and append something meaningful ;))
II. ip, just four times some numbers from 0 to 256, joined by a dot – not to hard (well don’t think many will a use for this ;))
So long, I think i’ll use this a lot. But: It would be even better, if you could release the source code, this could save you a lot of server bandwidth and I could personally add the features I like to see. Please think about it, you could release it on sourceforge / freshmeat / wherever.
Very nice, but can you make a downloadable version? I’d love to be able to create 100.000 rows for some heavy performance testing.
This is awesome, great work!
any chance you might open source this?
Any chance you would be willing to open source the code. I would like to use, but need significantly larger numbers than 5000 and perfectly understand you limits.
Great job man… I love it, and it’s just what I need.
One suggestion though… add a datatype for a custom string that I can enter.
My Problem: I’m using PostgreSQL and I need to populate an id field which is an incrementing value tracked by the DB. To insert I need to enter this in the value field: (SELECT nextval(‘clients_id_seq’)).
There’s no way for me to enter in custom values, so I have to output a date range for one day (12/1/2006) and then do a search and replace to get the proper column value.
Other than that, it’s pretty darn sweet. Oh, and I would love an open source version as well or I’d even pay a few bucks for it.
Hey guys,
Awesome – thanks for the input. Lots of great suggestions! This is actually pretty overwhelming – and not just for the server.
First thing’s first: I’ll make the script downloadable in the next day or two. Initially I’ll just zip everything up, but I’ll move it to SourceForge once I get a bit more time.
I’ll answer all the comments above when I get home tomorrow.
All the best!
Good job on the program, but here’s a few suggestions:
1) It’d be nice if the postal/zip code information had an option to *actually match* that of the country being randomly generated… not, say, a Canadian postal code for a US country record.
2) It’s a common misconception that Canadian postal codes are simply “Letter-Number-Letter Number-Letter-Number”. NOT ALL LETTERS are used! Only letters ABCEGHJKLMNPRSTVWXYZ are used, because the letters DFIOQ causes problems with optical character recognition of envelopes, so Canada Post does not use them. All ten numeric digits are used. An option for “sloppy postal checking” may, therefore, also be an option… because lots of programmers don’t expect it. :-)
Can I help to add Country-specific data for French … if so mail me, I’d be glad to add this to your generator ;)
Thanks a lot man.. you eased out most of my worries… making up all that data was rather boring.. ur data generator has made it so easy.. thanks again :d
rohan
Very neat tool. Thank you.
It would be nice to see a ‘unique key’ type field included – preeti
This is awesome tool.
It will even cooler if you can create attributes for XML format
This is very useful. I would love to also be able to generate a second column of data based on the content of the first column. So have a random full name, then have it generate a login name based on that full name for that row. If I have a user name Joseph Smith, then that rows login will be jsmith.
You really should add a Paypal donations button on this page. It’s a GREAT tool.
I believe i found a small problem in process.php…
On or about line 47: $g_numResults = ($numResults > $MAX_RESULTS) ? $MAX_RESULTS : $numResults;
$numResults should be $g_numResults
Thanks for the great tool though! I have been waiting for something just like this (or I was going to to it myself when/if I ever found the time).
Hi
cool. But when i try to generate a sql (select the option sql) nothing happning. I don’t know why is that. but that’s the most important one for me.
thanks.
Take a look at my comment (#25) that should solve the problem for you…
Thanks, Nick. All fixed.
Great tool!…i do some web.development in php (and i could be useful in my spare time wich isnt much)…so if u decide u could use a hand…beep! :) cheers!
Excellent tool.
As mentioned in comment 18, some context-awareness/synchronization would be great. For example, if I output the short state code and the full state name.
It would be great for you to add the generic functionality to allow me to create, for example, a state table. This would require (in addition to the previous point) marking a column as unique. For example if I designated an ST column as unique, I’d get one occurrence of all unique values – all 50 states – as long as I requested at least 50 records.
Also – CSV – YES, but take it a step further and allow me to choose my delimiter. Choose from the usual suspects (comma, tab, space, pipe, etc.) and also let me enter an ASCII code for ultimate flexibility.
Very nice tool.
Would be really useful to me if the 200 row limit was increased to
a couple of thousand.
,Stefan
Thanks for the tool. The downloadable version was not working on my localhost. It was very strange. HTML, XML and SQL worked. Excel and CSV did not. It took me 20 minutes to find that your program depends on register_globals = ON !!! Very bad PHP coding practise !!!
Ack! Thanks Jozef, obviously I agree – it was just an oversight. For some reason my hosting company have left register globals on and I didn’t check it. I’ll fix this up soon and re-post the code. Thanks!
When I generate this mysql table:
CREATE TABLE customer (
id mediumint(8) unsigned NOT NULL auto_increment,
last varchar(255) default NULL,
first varchar(255) default NULL,
add1 varchar(255) default NULL,
city default NULL,
state varchar(50) default NULL,
zip varchar(10) default NULL,
entrydate varchar(50) default NULL,
age varchar(50) default NULL,
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1;
The “city” is missing the datatype.
To fix this, in sql.php, on line 30 change the map to include city:
$map = array(
“Name” => “varchar(255)”,
“Phone” => “varchar(255)”,
“Email” => “varchar(255)”,
“Street-Address” => “varchar(255)”,
“Alphanumeric” => “varchar(255)”,
“List” => “varchar(255)”,
“Postal-Zip” => “varchar(10)”,
“Country” => “varchar(50)”,
“State-Province” => “varchar(50)”,
“City” => “varchar(50)”,
“Date” => “varchar(50)”,
“Number-Range” => “varchar(50)”,
“Text-Fixed” => “TEXT”,
“Text-Random” => “TEXT”
);
Thank you for releasing the code – this is very useful.
Thanks, citybugman! I’ll update this and the Register Global issue today (so expect the download file to be updated in the next 48 hours or so).
All the best –
it works fine to Opera, too.
should put it on the browsers list there ;)
great work!
Hi,
I love the app. I just dl the lastest version, and installed it on my windows box running xampp. Everything works great except the csv & excel. I saw the comment posed by Jozef, and turned on Register Global, but no luck. Any other reason these exports wouldn’t work?, or has anyone gotten it to work with windows & xampp.
thanks
Really a nice tool i will defiantly help. Please introduce the option to accept the schema and then generate the data accordingly.
Export option should be available for Microsoft SQL Server and ORACLE.
Very useful! Already tried it for my sql database work.
Few suggestions: there could be option to generate time (with the date together).
Generate last names
Good work!!!!
I’ll totally going to bookmark this page! This is so useful when your prof wants you to make up a large piece of data and you’re too lazy to do it.
This seems a really good tool, for testing large application forms – is there any way in which the details entered e.g. column names can be saved, rather than having re-enter every time?
I made some changes to the csv.php. It was outputting an extra $delimiter at the end of each row.
// output the titles
foreach ($template as $col)
{
if ($first_time == false)
echo $delimiter;
echo $col[0];
$first_time = false;
}
echo $newline;
for ($row=1; $row
Hi guys,
Andrew – not yet, I’m afraid. But it’s on the list of things to do…
Dave – that’s odd, I took a look at the code and it looked okay. Would you mind sending me an email (ben.keen AT gmail DOT com) with your fix? It looks like it got cut off.
thx!
The email address generator seems to generate invalid addresses occasionally. That’s not necessarily a bad thing for test data, but I thought perhaps it may be unintentional.
Examples:
ullamcorper.velit@cubiliaCurae;.ca
et.euismod@cubiliaCurae;Phasellus.org
posuere.cubilia.Curae;@liberomaurisaliquam.org
cubilia.Curae;@telluslorem.com
Note the semi-colons.
Fantastically useful though!
Dave
Hey Dave,
Yeah that’s a bug. I want to add a controlled way to screw up the data to simulate “real” input – but in the meantime, the data should be valid…! I’ll take a look at this when I can.
thx!
It would be nice if there was an option available to generate data as attribute or node.
I’m having the same issue as bc posted in #37. In this case, I’m running WampServer locally on my laptop. Excel and CSV are not producing an output.
Ben,
Fantasitic work, i think you are the only opensource (free) data generator available. I will paypal you a small amount of money, i think you deserve it.
I am having the same issue as Zool in #47, where the EXCEL output is not working, it seems to react by running the excel.php file but has no output or file or such. I too am running WAMP server for what it matters. Do you have any ideas as to why this is the case.
All the best,
Thanks and regards,
Kayvan Javid
Hi Kayvan,
Thanks for the donation! I very much appreciate it. I confess I really don’t know what’s causing the problem you guys are having… possibly the Excel & CSV headers being sent aren’t being understood, though you’d think that would be more likely be due to the browser rather than the OS / server. Sorry, I’m going to have to revisit this problem later when I get a little spare time. Just FYI, I’ll be moving the script to a separate site in the next few months and will start on a number of long-overdue improvements. I’ll investigate this problem then. Sorry it couldn’t be sooner. :-(
Ben
$resultType = $_POST[‘resultType’];
at the beginning of process.php.
whithout this, headers for EXCEL, CSV, XML won’t be added.