WWW::Mechanize for testing

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx






[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux