We use Selenium extensively to handle integration testing of our Perl/JavaScript-based application and it works quite well. You have to spend some time getting things bootstrapped for your needs, but after that it is very nice. We started with a test suite like the one you show below, often recorded using the Selenium IDE. After that we enhanced the system so that now we have our own natural language layer we use to build tests. (The natural language allows business analyst to read the tests.)<div>
<br></div><div>Selenium testing is valuable for regression testing as well. We can run the test suite and know with reasonable certainty that new changes to the Perl code or the JavaScript haven&#39;t broken the app in any of the major browsers. (Or that it has and either a test or the app needs to be fixed.)</div>
<div><br></div><div>In general, when writing web applications, I would recommend writing internal unit tests to verify that your models and business logic is correct, but use Selenium or something like it to handle the integration tests.</div>
<div><br></div><div>Unfortunately, I have no practical advice to offer since I&#39;m not the testing guru and haven&#39;t really messed with Selenium myself in 2-3 years. :)<br><br><div class="gmail_quote">On Wed, Jan 12, 2011 at 11:31 AM, djgoku <span dir="ltr">&lt;<a href="mailto:djgoku@gmail.com">djgoku@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On Wed, Jan 12, 2011 at 11:17 AM, Doug Sparling &lt;<a href="mailto:doug.sparling@gmail.com">doug.sparling@gmail.com</a>&gt; wrote:<br>

&gt; If you&#39;re automating your tests, I&#39;d go with something like the Selenium<br>
&gt; library. I haven&#39;t done much Perl for three or four years, so I can only<br>
&gt; speak from experience that&#39;s non-Perl related. We used Selenium (and<br>
&gt; Cucumber/Webrat, as at the time I was doing RoR) for automated integration<br>
&gt; testing, testing forms, and TDD/BDD. If it&#39;s off the cuff/simple testing,<br>
&gt; I&#39;d use curl.<br>
<br>
</div>When you used Selenium did you do form testing? I am not sure what all<br>
needs to be tested.<br>
<br>
I currently have this(Test::WWW::Mechanize):<br>
$mech-&gt;get_ok(&#39;<a href="http://localhost:3000/form&#39;" target="_blank">http://localhost:3000/form&#39;</a>);<br>
$mech-&gt;title_is(&#39;AppName&#39;, &#39;Make sure were on the AppName page&#39;);<br>
$mech-&gt;submit_form_ok({form_number =&gt; 1, fields =&gt; { name =&gt; &#39;test&#39;<br>
}}, &#39;adding a name worked&#39;);<br>
<br>
But if I change submit_form_ok to (the test still passes even though I<br>
didn&#39;t pass in the name field):<br>
$mech-&gt;submit_form_ok({form_number =&gt; 1}, &#39;adding a name shouldn&#39;&#39;t work&#39;);<br>
<div><div></div><div class="h5"><br>
Jonathan<br>
_______________________________________________<br>
kc mailing list<br>
<a href="mailto:kc@pm.org">kc@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/kc" target="_blank">http://mail.pm.org/mailman/listinfo/kc</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Andrew Sterling Hanenkamp<br><a href="mailto:sterling@hanenkamp.com">sterling@hanenkamp.com</a><br>785.370.4454<br>
</div>