views:

81

answers:

2

Possible Duplicate:
Integration Testing for a Web App

I've recently delved into Perl and I'd like to learn how to automate web site testing. To that end I'd appreciate answers to the following:

  1. What modules from CPAN should I look into? Is there something similar to Watir (I know there's a Windows only port of it in Perl)?
  2. I'm using a Windows system, so does it matter if I use ActivePerl or Strawberry Perl?
  3. What books should I look into (aside from "Perl Testing: A Developer's Notebook")?

Edit:

  1. The web application is written in Java
  2. I want to test the application's web GUI, which makes use of javascript/ajax & some flex/flash
+2  A: 
  1. WWW::Mechanize, WWW::Selenium and LWP::Simple just to name a few.

  2. ActivePerl is more user friendly than Strawberry when it comes to downloading CPAN modules, but at the end of the day they are both equally as good.

  3. I haven't come across any books on the subject; perhaps a tutorial is what you need.

Zaid
+1  A: 

Are you interested testing the WEB GUI itself via http calls or individual Perl modules via calling Perl code directly?

For the former, Selenium - which AFAIK is not Perl specific at all - seems to be the accepted Best Practice (see http://stackoverflow.com/questions/1747772/integration-testing-for-a-web-app link helpfully provided by Ether ). It has a Perl CPAN module for integration, mentioned in the same SO question.

You can of course do your own testing frameworks, e.g. implement http calls via WWW::Mechanize. But that would not work with JavaScript-enabled web sites (are there any left that aren't?) since you need a JavaScript engine, either provided by the browser (Selenium's approach) or something embedded which AFAIK Perl doesn't actually have, though Java does.

However, there are non-http approaches to testing Perl side code of the web apps as well:

  • Have all non-presentation logic nicely modularized away, and test it as usual using Test::More or your other favorite test frameworks.

  • Test presentation (or presentation+logic) by using your web framework in command line mode, emulating running on web server. CGI.pm allows that, as well as EmbPerl. Not sure about Catalyst apps.

DVK