Tuesday, May 5, 2009

Perl Client for Selenium Install

Ok, so finally I got Selenium with Perl to work again!! And this time I am going to jot down the steps.
1. Install Perl
2. Download Selenium Perl "CLIENT" from Luke Cross, located here - http://search.cpan.org/~lukec/Test-WWW-Selenium-1.13
3. Unzip the download and follow the instructions in readme file.
"
To install:

perl Makefile.PL
make
make test
make install
"
Note: Instead of 'make' use 'nmake' on windows machine.
4. Now is the tricky part - selenium.pm is available in multiple places and we have to be careful to be using the right one. File located at C:\Installs\Selenium\Test-WWW-Selenium-1.13\Test-WWW-Selenium-1.13\lib\Test\WWW is a 7kb file that is different from the 65kb file located at C:\Installs\Selenium\Test-WWW-Selenium-1.13\Test-WWW-Selenium-1.13\lib\WWW. Make sure to be using/pointing to the 7kb file and you are good to go!

More info on how to use the Perl Client driver is available at -
http://seleniumhq.org/documentation/remote-control/languages/perl.html

-V

Sunday, April 26, 2009

Compilation Error

Error -
D:\Selenium\PerlTestCases>perl Test-userverify.pl
Can't locate Test/LongString.pm in @INC (@INC contains: C:\Perl\lib C:\Perl\site\lib C:/Perl/site/lib C:/Perl/lib .) at C:\Perl\site\lib/Test/WWW/Selenium.pm line 56.
BEGIN failed--compilation aborted at C:\Perl\site\lib/Test/WWW/Selenium.pm line 56.
Compilation failed in require at Test-userverify.pl line 4.
BEGIN failed--compilation aborted at Test-userverify.pl line 4.

Analysis:
http://aspn.activestate.com/ASPN/Mail/Message/perl-unix-users/2010251
========================

>  The  following is the error i  getback.
>
> perl test.pl
> Can't locate XML/Simple.pm in @INC (@INC contains:
> /usr/local/lib/perl5/5.00503/sun4-solaris-thread
> /usr/local/lib/perl5/5.00503
> /usr/local/lib/perl5/site_perl/5.005/sun4-solaris-thread
> /usr/local/lib/perl5/site_perl/5.005 .) at test.pl line 1.
> BEGIN failed--compilation aborted at test.pl line 1.
>
>
> Questions :
> 1. Can the xml parser libraries be used in the above version of perl
> itself. At the code level itsel without any config or env. changes that
> need root access - as if root access is needed it becomes a long winding
> process as this is a prod. box.
> 2. If i can't use the above xml Can i locally install within the userid
> scope i am working on.

It looks like you are just having the typical problem of the perl binary not
the XML module in it's @INC path. You might want to check in
/usr/local/lib/perl5 and /usr/local/lib/perl5/site_perl for any other
versions of perl installed, or a 'where perl' or 'which perl', to see if
there are any other perl binaries installed. Perhaps there is another
perl installation on the system that has the XML module.

If the system does not have the XML module installed and you do not have
root access to install the module, you can install the module in the
same directory as your script, though you'll have to create the
directories by hand and do the installation manually. You'd have to
download and compile/build the XML module, then create the necessary
directories and place the appropriate files there. For example:

ls -l:
XML/Simple.pm
XML.pm

Something like that.
=============================================

This post has some info on the issue. I do have 2 vsn of perl installed - one came with the Oracle install, and 2nd (latest) is the one I installed manually. I dont want to mess with the oracle install...so I just updated the Path env variable - although it din have any effect...
Next I tried to install/compile the package missing locally(LongString). I copied the LongString.pm file to the expected folder.
Above error went away, but another one popup up. That will be discussed in future post..

-V.

Complition error - when Selenium WWW not installed

D:\Selenium\PerlTestCases>perl Test-userverify.pl
Can't locate Test/WWW/Selenium.pm in @INC (@INC contains: C:\Perl\lib C:\Perl\site\lib C:/Perl/site/
lib C:/Perl/lib .) at Test-userverify.pl line 4.
BEGIN failed--compilation aborted at Test-userverify.pl line 4.

Resolution:
Downloaded "WWW::Selenium - Perl driver for the Selenium testing framework" from http://search.cpan.org/~MBARBON/Test-WWW-Selenium-0.03/lib/WWW/Selenium.pm
Following build/install instructions.