×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Tests advice? Broswer to PostgreSQL database

Tests advice? Broswer to PostgreSQL database

Tests advice? Broswer to PostgreSQL database

(OP)
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/WWW with 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

RE: Tests advice? Broswer to PostgreSQL database

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 WWW-Mechanize. By itself, last I checked, WWW-Mechanize does not support JavaScript. If JavaScript is a requirement, you could take a look at WWW-Scripter and the plugin WWW-Scripter-Plugin-JavaScript. And since WWW-Mechanize is a subclass of LWP-UserAgent, it shouldn't be too difficult to get cookies working.

RE: Tests advice? Broswer to PostgreSQL database

(OP)
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

RE: Tests advice? Broswer to PostgreSQL database

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 WWW::Mechanize FAQ

RE: Tests advice? Broswer to PostgreSQL database

(OP)
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

RE: Tests advice? Broswer to PostgreSQL database

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. smile You'll probably want to make sure the back end handles those cases too.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close