469,336 Members | 5,570 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,336 developers. It's quick & easy.

How to Automate the Website using perl module

Hi All
I Have installed Active perl in my system and I am new to perl and automation...Could some one tell me how to install the perl modules and how to use those modules with the perl for autmating the website ... it will be very helpful for me to start automation...
Oct 10 '08 #1
8 4041
Hi there,

To install the perl modules can refer this link:

http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlmodinstall.html

To answer your 2nd question, it's better to get it from the perl experts from this forum as even am newbiee to perl.

Regards,
Vijayarl
Oct 10 '08 #2
numberwhun
3,503 Expert Mod 2GB
CPAN provides excellent documentatio on installing perl modules. To use the module, you would first install it, then, specify it in the beginning of your Perl script as such:

Expand|Select|Wrap|Line Numbers
  1. use DBI;
  2.  
or even:

Expand|Select|Wrap|Line Numbers
  1. use Config::Scoped;
  2.  
Those are real module examples. What you put will depend on what module you are using. To use a module, you have to look at its page on CPAN as it will instruct you in its use.

Regards,

Jeff
Oct 10 '08 #3
KevinADC
4,059 Expert 2GB
If you are using active perl you use the PPM application to install modules. Activeperl comes with a lot of documentation, so find the documentation (in the activeperl folder) and read it.

Automation could mean anything so there is no way to help with that unless you specify what you want or are trying to do.
Oct 10 '08 #4
If you are using active perl you use the PPM application to install modules. Activeperl comes with a lot of documentation, so find the documentation (in the activeperl folder) and read it.

Automation could mean anything so there is no way to help with that unless you specify what you want or are trying to do.
Hi Kevin Thanks for ur reply

What i have to do is I want to Login in to my site by entering username and password and later i want to click on any button for furthur process..

And i am working on windows machine ie Windows XP...
Oct 13 '08 #5
über
31
This might help
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. #-----------------------------
  3. # GET REQUEST
  4. #
  5. use LWP::Simple;
  6. use URI::URL;
  7.  
  8. my $url = url('http://login.yahoo.com/');
  9. $url->query_form(username => 'peter', password => 'secret');
  10. $content = get($url);
  11.  
  12. #-----------------------------
  13. # POST REQUEST
  14. #
  15. use HTTP::Request::Common qw(POST);
  16. use LWP::UserAgent;
  17.  
  18. $ua = LWP::UserAgent->new();
  19. my $req = POST 'http://login.yahoo.com/',
  20.    [ username => 'peter', password => 'secret' ];
  21. $content = $ua->request($req)->as_string;
Oct 13 '08 #6
numberwhun
3,503 Expert Mod 2GB
This might help
Expand|Select|Wrap|Line Numbers
  1. #!/usr/bin/perl
  2. #-----------------------------
  3. # GET REQUEST
  4. #
  5. use LWP::Simple;
  6. use URI::URL;
  7.  
  8. my $url = url('http://login.yahoo.com/');
  9. $url->query_form(username => 'peter', password => 'secret');
  10. $content = get($url);
  11.  
  12. #-----------------------------
  13. # POST REQUEST
  14. #
  15. use HTTP::Request::Common qw(POST);
  16. use LWP::UserAgent;
  17.  
  18. $ua = LWP::UserAgent->new();
  19. my $req = POST 'http://login.yahoo.com/',
  20.    [ username => 'peter', password => 'secret' ];
  21. $content = $ua->request($req)->as_string;
Just a bit of advice Uber, it is highly advised and recommended in "Perl Best Practices" to put all of your "use" statements at the top of your script. You don't want to scatter them throughout your script or finding dependencies for scripts will be hell for others. I, personally, would not want to support code that did something like that. I have supported some pretty bad code and it is never fun!

Regards,

Jeff
Oct 13 '08 #7
Just a bit of advice Uber, it is highly advised and recommended in "Perl Best Practices" to put all of your "use" statements at the top of your script. You don't want to scatter them throughout your script or finding dependencies for scripts will be hell for others. I, personally, would not want to support code that did something like that. I have supported some pretty bad code and it is never fun!

Regards,

Jeff
Hey jeff..Thnk u very much..

And one thing i want to know is i can run these scripts in perl express right? or do i need to run in any other toll..Just mention those if possible..
Basically perl express is a editor i am using right now.....

And actually LWP module is itself installed while installing active perl in my sys....ie..LWP perl module pogram is existing in the path C:\Perl\lib\LWP

Do i need to install again if i use these in my scripts

Thanks in advance
Oct 16 '08 #8
numberwhun
3,503 Expert Mod 2GB
Hey jeff..Thnk u very much..

And one thing i want to know is i can run these scripts in perl express right? or do i need to run in any other toll..Just mention those if possible..
Basically perl express is a editor i am using right now.....

And actually LWP module is itself installed while installing active perl in my sys....ie..LWP perl module pogram is existing in the path C:\Perl\lib\LWP

Do i need to install again if i use these in my scripts

Thanks in advance
If its installed, then no, you shouldn't have to install them again, just the once. I don't know anything about Perl Express, but when you run perl scripts, you should really be running them from the command line to test them. Use the following format for that:

Expand|Select|Wrap|Line Numbers
  1. c:> perl scriptname.pl
  2.  
Oct 16 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by Keith | last post: by
17 posts views Thread by Michael McGarry | last post: by
2 posts views Thread by Xah Lee | last post: by
1 post views Thread by Someone | last post: by
2 posts views Thread by vallinayagam | last post: by
10 posts views Thread by rdps | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.