in reply to Stories from the front
making sure that a valid page (HTTP code is 200) gets returned
Unfortunately, you can't rely on a response code of 200 always indicating success - some web servers (I've heard) return that code even for a failed request. I think (I'm open to correction) your best bet is to check that the returned data is 'good' in some way, e.g.
my $mech = WWW::Mechanize->new; $mech->get( $page ); is( $mech->title(), "Alex's Wacky Widgets", "page GET success" );
or, with Test::WWW::Mechanize, which you might like to check out:
$mech->title_is( "Alex's Wacky Widgets" );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Stories from the front
by talexb (Chancellor) on Jan 05, 2009 at 01:03 UTC | |
|
Re^2: Stories from the front
by mr_mischief (Monsignor) on Jan 05, 2009 at 14:52 UTC | |
by missingthepoint (Friar) on Jan 06, 2009 at 07:33 UTC |