| Apache2::ASP::Test::UserAgent - User-agent for testing Apache2::ASP web applications |
Apache2::ASP::Test::UserAgent - User-agent for testing Apache2::ASP web applications
use Apache2::ASP::Test::UserAgent; my $ua = Apache2::ASP::Test::UserAgent->new( $asp ); my $response = $ua->get( '/index.asp' ); my $response = $ua->post( '/handlers/FormHandler', [ username => 'admin', password => 's3cr3t', ]); my $response = $ua->upload( '/handlers/UploadHandler', [ title => 'this is my file', filename => ['/path/to/file.txt'] ]); # $response is a regular HTTP::Response object, so...: if( $response->is_success ) { # Everything worked out OK. } else { # Request failed. }# end if() # Deal with forms: use HTML::Form; my $response = $ua->get( '/some-form.asp' ); my $form = HTML::Form->parse( $response->content, '/some-form.asp' ); $form->find_input( 'username' )->value( 'admin' ); $form->find_input( 'password' )->value( 's3cr3t' ); my $after_response = $ua->submit_form( $form );
Apache2::ASP::Test::UserAgent offers the ability to test your web applications without requiring
a running Apache webserver or direct human interaction.
Simply by using the Devel::Cover manpage you can easily generate code-coverage reports on your ASP scripts. Such coverage reports can be used to tell you what code is executed during your tests.
After creating an instance of Apache2::ASP::Test::UserAgent you cannot print to STDOUT.
However you can warn just fine.
Returns the the Apache2::ASP manpage object currently in use by the Apache2::ASP::Test::UserAgent object.
Constructor. The $asp argument should be an Apache2::ASP::Base object.
Returns a new Apache2::ASP::Test::UserAgent object.
Appends a cookie to be sent on all future requests.
Makes a GET request to $url via the Apache2::ASP::Base manpage.
Content-encoding is application/x-www-form-urlencoded.
Returns an the HTTP::Response manpage object.
Makes a POST request to $url via the Apache2::ASP::Base manpage, sending $content as its request data.
Content-encoding is application/x-www-form-urlencoded.
Returns an the HTTP::Response manpage object.
Makes a POST request to $url via the Apache2::ASP::Base manpage, sending $content as its request data.
Content-encoding is multipart/form-data.
Returns an the HTTP::Response manpage object.
$form should be a valid HTML::Form object. The $form is submitted via its click() method,
and the resulting the HTTP::Request manpage object is processed.
Returns a the HTTP::Response manpage object.
It's possible that some bugs have found their way into this release.
Use RT http://rt.cpan.org/NoAuth/Bugs.html to submit bug reports.
Please visit the Apache2::ASP homepage at http://www.devstack.com/ to see examples of Apache2::ASP in action.
John Drago mailto:jdrago_999@yahoo.com
Copyright 2007 John Drago, All rights reserved.
This software is free software. It may be used and distributed under the same terms as Perl itself.
| Apache2::ASP::Test::UserAgent - User-agent for testing Apache2::ASP web applications |