validat eurl

i have to validate login process of my website.
here is what i have to :
1: request connection to this URL from the browser:
https://xxxxxxxxxxxxxxxxxxxxxx

2: verify that browser has connected to this URL (a redirect):
https://yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy

3: input login aaaaaaaaaaaaaaaaaaaa and password ************* and
   activate "Log In" button

4: verify that browser has connected to this URL:
https://zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

5: input e-mail address ***************************** and activate
   "Continue" button

6: verify that browser has connected to this URL:
https://aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa


any suggestion how to do this thru perl script. do i have to maintain cookies in the script.
LVL 1
shahrahulbAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

manav_mathurCommented:
Is this a web-site testing script??

Manav
0
shahrahulbAuthor Commented:
Yes.
0
manav_mathurCommented:
0
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

gripeCommented:
WWW::Automate hasn't been updated in 3 years and is no longer maintained.

I would suggest a more common (and widely used) module like 'WWW::Mechanize' which is full of features, very well written and currently maintained. Andy Lester has also written a Mech subclass specifically geared for Web testing called 'Test::WWW::Mechanize' specifically geared for testing purposes. Both module's are available in Andy's PAUSE directory (http://search.cpan.org/~petdance/)  or specifically at:

http://search.cpan.org/~petdance/Test-WWW-Mechanize-1.02/
http://search.cpan.org/~petdance/WWW-Mechanize-1.11_02/

I also noticed that your test plan contains a redirect. You should be aware that javascript redirects will not be parsed properly by these modules and that you'll have to parse out and respond to the javascript manually. (If you're indeed using a javascript redirect rather than an actual HTTP redirect.)

Hope that helps.
0
shahrahulbAuthor Commented:
but, can i do post and get request using Test-WWW-Mechanize-1.02
because at certain stage i have enter login information
Rahul
0
shahrahulbAuthor Commented:
i m trying to install WWW-Mechanize
i m getting the error:

summer>>perl Makefile.PL PREFIX=/u/rshah1/tools-www

Part of WWW::Mechanize's test suite is run live tests against Google.
Since it looks like you're connected to the Internet, these test will
be enabled.  If you want to disable these tests, re-run Makefile.PL with
the --skiplive switch.

Do you want to install the mech-dump utility? [y] n  

WWW::Mechanize likes to have a lot of test modules for some of its tests.
The following are modules that would be nice to have, but not required.

        Test::Pod
        Test::Memory::Cycle
        Test::Warn


Warning: prerequisite HTML::Form failed to load: Can't locate HTML/Form.pm in @INC (@INC contains: /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl .) at (eval 23) line 3, <STDIN> line 1.
Warning: prerequisite HTML::TokeParser 2.28 not found at /usr/local/lib/perl5/5.6.1/ExtUtils/MakeMaker.pm line 343, <STDIN> line 1.
Warning: prerequisite HTTP::Request 1.3 not found at /usr/local/lib/perl5/5.6.1/ExtUtils/MakeMaker.pm line 343.
Warning: prerequisite LWP 5.76 not found at /usr/local/lib/perl5/5.6.1/ExtUtils/MakeMaker.pm line 343.
Warning: prerequisite LWP::UserAgent 2.024 not found at /usr/local/lib/perl5/5.6.1/ExtUtils/MakeMaker.pm line 343.
Warning: prerequisite Test::More failed to load: Can't locate Test/More.pm in @INC (@INC contains: /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl .) at (eval 31) line 3.
Warning: prerequisite URI 1.25 not found at /usr/local/lib/perl5/5.6.1/ExtUtils/MakeMaker.pm line 343.
Writing Makefile for WWW::Mechanize
0
kanduraCommented:
The prefered way of installing perl modules is by using the CPAN module. That will take care of missing dependencies, for one thing, and that is what you're suffering from now.
Typically a decent Perl installation comes with the "cpan" utility. This makes installing new modules as simple as typing:

    cpan WWW::Mechanize

If cpan isn't available, then try this:

    perl -MCPAN -e shell
and type
    install WWW::Mechanize
0
shahrahulbAuthor Commented:
i think so i have installed the module.
i
my perl script contains:
use strict;
use lib '/u/rshah1/toolswww/lib/site_perl/5.6.1/';
use HTTP::Cookies;
use HTTP::Request::Common;
use LWP::UserAgent;
use Sys::Hostname;
use Time::Local;
use Crypt::SSLeay;
use WWW::Mechanize;


i get error
HTTP::Request version 1.3 required--this is only version 1.24 at /u/rshah1/toolswww/lib/site_perl/5.6.1//WWW/Mechanize.pm line 98.
BEGIN failed--compilation aborted at /u/rshah1/toolswww/lib/site_perl/5.6.1//WWW/Mechanize.pm line 98.
Compilation failed in require at ./del.pl line 11.
BEGIN failed--compilation aborted at ./del.pl line 11.

and line 11 contains the "use WWW::Mechanize"
0
kanduraCommented:
what do you suppose "HTTP::Request version 1.3 required--this is only version 1.24" means? It means you have to upgrade that module...

   cpan HTTP::Request
0
shahrahulbAuthor Commented:
i have installed the module properly.
script:
#!/usr/local/bin/perl
use strict;
use lib '/u/rshah1/toolswww/lib/site_perl/5.6.1/';
use lib '/u/rshah1/mechanize/lib/site_perl/5.6.1';
use HTTP::Cookies;
use HTTP::Request::Common;
use LWP::UserAgent;
use Sys::Hostname;
use Time::Local;
use Crypt::SSLeay;
use WWW::Mechanize;

my $mech = WWW::Mechanize->new();
my $url = 'https://zzzzz';
$mech->get( $url )


when i run the script i get error:
Not a GLOB reference at /usr/local/lib/perl5/site_perl/5.005/HTML/TokeParser.pm line 43.
0
shahrahulbAuthor Commented:
this is painful. i reinstalled the HTML::TokenParser
now i m getting error:

Can't locate HTML/Tagset.pm in @INC (@INC contains: /u/rshah1/CPAN/lib/site_perl/5.6.1/sun4-solaris /u/rshah1/CPAN/lib/site_perl/5.6.1 /u/rshah1/mechanize/lib/site_perl/5.6.1/sun4-solaris /u/rshah1/mechanize/lib/site_perl/5.6.1 /u/rshah1/toolswww/lib/site_perl/5.6.1//sun4-solaris /u/rshah1/toolswww/lib/site_perl/5.6.1/ /usr/local/lib/perl5/5.6.1/sun4-solaris /usr/local/lib/perl5/5.6.1 /usr/local/lib/perl5/site_perl/5.6.1/sun4-solaris /usr/local/lib/perl5/site_perl/5.6.1 /usr/local/lib/perl5/site_perl/5.005/sun4-solaris /usr/local/lib/perl5/site_perl/5.005 /usr/local/lib/perl5/site_perl .) at /u/rshah1/CPAN/lib/site_perl/5.6.1/sun4-solaris/HTML/TokeParser.pm line 12.
BEGIN failed--compilation aborted at /u/rshah1/CPAN/lib/site_perl/5.6.1/sun4-solaris/HTML/TokeParser.pm line 12.
Compilation failed in require at /u/rshah1/CPAN/lib/site_perl/5.6.1/WWW/Mechanize.pm line 101.
BEGIN failed--compilation aborted at /u/rshah1/CPAN/lib/site_perl/5.6.1/WWW/Mechanize.pm line 101.
Compilation failed in require at ./del1.pl line 13.
BEGIN failed--compilation aborted at ./del1.pl line 13.



can someone explain me how to install WWW::Mechanize from scratch so that i can run simple script that i given above
0
kanduraCommented:
   perl -MCPAN -e shell

    force install WWW::Mechanize
0
shahrahulbAuthor Commented:
but where the module will be exactly installed. what path should i use from my script.
i mean use lib 'blah blah.......'

so that i can run simple script:
my $mech = WWW::Mechanize->new();
my $url = 'https://zzzzz';
$mech->get( $url )

also, after installing module, can i do the 5 steps i asked in my orignal question. top most part of this page
0
kanduraCommented:
they will be installed wherever perl can find them on its own. You don't need any 'use lib' statements.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
shahrahulbAuthor Commented:
u didn't answer my other question
also, after installing module, can i do the 5 steps i asked in my orignal question. top most part of this page
0
kanduraCommented:
gripe's comment should be sufficient. Your responsibility is to read the documentation of Test::WWW::Mechanize and WWW::Mechanize first. You'll find it is very simple to do what you want.
I never intended to completely answer your main question when I commented about how to install modules, but here's a start:

use Test::WWW::Mechanize;

$mech = new Test::WWW::Mechanize;

$mech->get( 'https://xxxx' );

die "Didn't follow redirect: " . $mech->uri unless $mech->uri eq 'https://yyyy';

$mech->submit_form(
        form_number => 0,
        fields      => {
            username    => 'mungo',
            password    => 'lost-and-alone',
        }
    );
 

etcetera.
0
shahrahulbAuthor Commented:
i have installed. WWW::Mechanize
can i do
use Test::WWW::Mechanize;

0
shahrahulbAuthor Commented:
i m creating a new question for this
0
kanduraCommented:
Test::WWW::Mechanize adds a couple of handy testing methods to the original WWW:::Mechanize, so you can do without it. The snippet I showed you doesn't actually use any Test:: specific things.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Perl

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.