Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Tests advice? Broswer to PostgreSQL database

Status
Not open for further replies.

MrCBofBCinTX

Technical User
Dec 24, 2003
164
US
I want to write tests for my application that views (with searches), inserts and updates a PostgreSQL database. I need to test the web side to see if inserts and updates chain up and down through the tables. I also need to test the database side to see if those changes actually reflect web side actions.
I want to release all of this as a proper package open source.

I know that I will need to use something like LWP/ cookies.
and $dbh tests.
The web side can accept GET's without a problem.
I am inexperienced with testing besides some manual tests I have done.
Which revealed some nasty bugs.

I really need to do a lot of tests, but many are similar.
The insert and update tests are much harder since they run up/down into many other tables.

Are there any base/CPAN modules I should look at?
Thanks
 
I have only limited experience testing in a manner similar to what you're describing - but for filling out forms and clicking links on web pages I've been fairly happy with By itself, last I checked, does not support JavaScript. If JavaScript is a requirement, you could take a look at and the plugin And since is a subclass of LWP-UserAgent, it shouldn't be too difficult to get cookies working.
 
Ugh,
yes JavaScript is a requirement.
I hadn't thought of that.
I will look at those modules. Didn't even know about them.
I could possibly even use those for another script I have that hangs up on a site that requires JavaScript
 
Depending on how involved the javascript is and how comfortable you are with parsing it, you might be able to get by without implementing any kind of Javascript handling. Since javascript is plain text, you might be able to parse it, make note of any variables you need to worry about and do any data updating/validation from your perl script with some regexs. Here's the appropriate section from the [URL unfurl="true"]WWW::Mechanize FAQ[/url]
 
Yes, that's a better idea. The JavaScript is very simple. A value chosen in one select limits second select to possible values in the other one.
There are three (or more or less) groups of two coordinated selects.
Makes selecting the second value very user friendly
 
In that case it doesn't sound like you really need to implement javascript at all. Just choose your test values appropriately and, for the sake of testing, possibly also choose options that don't belong together just to see what happens - because, you know. someone could be using a perl script to fill out the forms and get something wrong. :) You'll probably want to make sure the back end handles those cases too.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top