Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I've been assigned the task of automating performance tests on some of our products. Do you think perl is a good choice for the web based automation. They are .asp pages that need input and then are to be submitted. What do you think of using Perl for the automation part?

Title edit by tye

Replies are listed 'Best First'.
Re: Automation
by mirod (Canon) on Jun 14, 2002 at 16:58 UTC
Re: Automation
by mfriedman (Monk) on Jun 14, 2002 at 16:54 UTC
    Perl would be an excellent choice for doing performance tests on your web applications. You can use the various LWP modules to build HTTP requests and go from there.
Re: Automation
by kvale (Monsignor) on Jun 14, 2002 at 17:14 UTC
    Perl is a generally excellent language for gluing applications together for the purpose of testing them. For your application, it sounds like you want an automated web client that fetches pages, stuffs them with info, and submits them. There are a number of CPAN modules that help you do just this.

    I have used LWP::Simple to good effect. Here is a snippet that gets a weather web page:
    use LWP::Simple; my $state = shift; my $url_base = 'http://iwin.nws.noaa.gov/iwin/'; $state = uc $state; # get the raw HTML page for $state my $url = lc($url_base . "$state/zone.html"); my $raw_data = get($url);
    There are many other LWP modules that offer great flexibility in web programming.

    -Mark
Re: Automation
by Rex(Wrecks) (Curate) on Jun 14, 2002 at 17:20 UTC
    Test Automation is now my job, and I can tell you that my tasks are much easier accomplished with Perl than any of the other languages I have been using which include TCL\Expect, and VB (*shudder*), as well as a couple proprietary ones: Visual Test, based on VB and WinRunner, based loosly on C.

    I still use the others for tasks which they are superior for but everything is glued together with Perl and Perl is the bulk of my new code.

    "Nothing is sure but death and taxes" I say combine the two and its death to all taxes!
Re: Automation
by stajich (Chaplain) on Jun 14, 2002 at 16:55 UTC
    Biased community here. Yes, Perl is a good tool for this. Use LWP and see examples about UserAgent to see how to store cookie and session information.
Re: Automation
by shotgunefx (Parson) on Jun 14, 2002 at 16:59 UTC
    Definitely. With Perl's amazing text munging capabilities and the LWP modules it can make things a snap.

    You might also want to check out this Web Application Test Suite Generator.

    -Lee

    "To be civilized is to deny one's nature."