http://qs1969.pair.com?node_id=442525

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

Hi monks

For my (web)application, i use WWW::Mechanize to test the front-end of the application

However, i'd like to make the tests more flexible, and more general using an XML-file like this:
<?xml version="1.0" encoding="ISO-8859-1"?> <root> <test> <msg>Describe your test here</msg> <item id="userid" type="inputtext">MyUserName</item> <item id="password" type="inputtext">IfIShouldTellYou< +/item> <action perform="checkItems">confirmTrue</action> <action perform="submitForm">confirmFalse</action> </test> <test> <msg>Another test</msg> <item id="login.pm" type="perlmodule" /> <action perform="loadModule">confirmTrue</action> </test> </root>

On this moment, i read the file using XML::Simple, but i see some drawbacks (like if there is only one test described, i can't iterate on the tests that are given as an array in the example above

Are there any monks with more thoughts or ideas on how to create a generic, multi purpose test-suite for perl based web applications?
Thanks for your input and ideas.

"We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.

Replies are listed 'Best First'.
Re: TestSuite in perl
by lachoy (Parson) on Mar 26, 2005 at 18:04 UTC

      He!, thanks, i did not know these modules, i look into them before reinventing the weel.

      "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.
Re: TestSuite in perl
by z3d (Scribe) on Mar 28, 2005 at 12:38 UTC
    Funny, I'm doing the same thing with a config::general schema. Not sure if this will help or not, but far too late in the game I came across Test::WWW::Mechanize - might be of some value



    "I have never written bad code. There are merely unanticipated features."
      Never too late. Thanks for your input, i'll look into it.
      Right now i've got HTTP::WebTest working, but no luck at WWW::Webrobot yet, the last script seems to run, but i get no feedback.

      I'll look at your option as well, i still have to find out what method suits me the best.
      "We all agree on the necessity of compromise. We just can't agree on when it's necessary to compromise." - Larry Wall.