httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Patton, Billy N" <billy.pat...@h3net.com>
Subject Re: [users@httpd] WWW::Mechanize for testing
Date Tue, 21 Oct 2014 16:00:33 GMT
Got it
On Oct 21, 2014, at 10:54 AM, Patton, Billy N <Billy.Patton@h3net.com> wrote:

> Trying to use WWW::Mechanize for my unit testing of an app.
> I requires a login, but this is something that comes before it hits my .cgi.
> 
> I believe it is using the .htaccess to get it’s data.
> 
> Here is my script using WWW::Mechanize.
> 
> #!/usr/bin/perl -w
> use strict;
> use warnings;
> use Data::Dumper;
> $Data::Dumper::Indent   = 1;
> $Data::Dumper::Sortkeys = 1;
> $Data::Dumper::Deepcopy = 1;
> use Test::More qw (no_plan);
> use Cwd;
> use WWW::Mechanize;
> 
> my $loginID   = 'dogs';
> my $password  = 'pigs';
> my $url       = 'http://cats.sheep/cp.cgi';
> my $mech      = WWW::Mechanize->new(); # start off the whole enchilada
> $mech->set_visible($loginID, $password);  # enter in the loginid and password
> $mech->get($url);
> 
> 
> 
> The documentation I have read tells me to use set_visible.
> 
> When I have it before the get I get the following error.
> HTML::Form::parse: No $base_uri provided at /Library/Perl/5.16/WWW/Mechanize.pm line
2759.
> 
> if I move it after the get I get the following error.
> 
> Error GETing http://billys-cportal-test.dfw0.hypercube-llc.com/cp.cgi: Authorization
Required at t/cportal.t line 31.
> 
> 
> So how do I do a get when the login stuff is not controlled by my App?
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message