Perl Compliation error: BEGIN failed--compilation aborted at line 4

3,266 views
Skip to first unread message

Venkata Naveen

unread,
Jan 7, 2011, 3:36:02 PM1/7/11
to Selenium Users
Hi All,
Finally after 2 days of struggle all perl dependencies below were
successfully installed and also successfully running remote control
running in teh background. However I am facing problem with script
compilation.
-----------------------------------------------------
C:\camelbox\bin>PERL MAKEFILE.PL
*** Module::AutoInstall version 1.03
*** Checking for Perl dependencies...
[Core Features]
- Test::More ...loaded. (0.72 >= 0.42)
- Test::Exception ...loaded. (0.27)
- Test::Mock::LWP ...loaded. (0.05)
- Test::Pod ...loaded. (1.26)
- LWP::UserAgent ...loaded. (5.826)
- URI::Escape ...loaded. (3.29 >= 1.31)
*** Module::AutoInstall configuration finished.
Writing Makefile for Test::WWW::Selenium
--------------------------------------------------------------
C:\camelbox\bin>PERL gtest.PL
Can't locate Test/WWW/Selenium.pm in @INC (@INC contains: C:/camelbox/
lib C:/
elbox/site/lib .) at gtest.PL line 4.
BEGIN failed--compilation aborted at gtest.PL line 4.
-----------------------------------------------------------------
Am I doing it correctly? - I have recorded script below in IDE
exported to notepad and saved as gtest.pl (perl file) saved in same
bin where all perl and other config lib files are installed
--------------------------------------------------------------------------------------------------------------------------
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;

my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*chrome",
browser_url =>
"www.seaatguru.com" );

$sel->open_ok("http://www.seatguru.com/");
$sel->title_is("Airline Seating Charts - Best Airplane Seats -
SeatGuru");
$sel->select_ok("sgs-airline-number", "label=Emirates");
$sel->type_ok("sgs-flight", "003");
$sel->click_ok("go-button-number");
$sel->click_ok("//table[\@id='flightTable']/tbody/tr[4]/td[2]");
$sel->wait_for_page_to_load_ok("30000");
-----------------------------------------------------------------------------------------------------------------------------------------
Need your help, if the script above was sufficient then why do I face
compilation error at line 4?

Best regards
Venkata


Bob McConnell

unread,
Jan 7, 2011, 4:02:09 PM1/7/11
to seleniu...@googlegroups.com
From: Venkata Naveen

> use strict;
> use warnings;
> use Time::HiRes qw(sleep);
> use Test::WWW::Selenium;
> use Test::More "no_plan";
> use Test::Exception;
>
> my $sel = Test::WWW::Selenium->new( host => "localhost",
> port => 4444,
> browser => "*chrome",
> browser_url =>
> "www.seaatguru.com" );
>
> $sel->open_ok("http://www.seatguru.com/");
> $sel->title_is("Airline Seating Charts - Best Airplane Seats -
> SeatGuru");
> $sel->select_ok("sgs-airline-number", "label=Emirates");
> $sel->type_ok("sgs-flight", "003");
> $sel->click_ok("go-button-number");
> $sel->click_ok("//table[\@id='flightTable']/tbody/tr[4]/td[2]");
> $sel->wait_for_page_to_load_ok("30000");
>
------------------------------------------------------------------------
--

> Need your help, if the script above was sufficient then why do I face
> compilation error at line 4?

It is looking for selenium.pm in C:\camelbox\site\lib\Test\WWW\, which
is where it is installed on my system. Is that module installed on
yours?

Also, if the pm file in the Selenium client library is newer than the
one installed from CPAN, replace the installed file with the newer one.
CPAN had not been updated with that release the last time I checked.

Bob McConnell

naveen v

unread,
Jan 7, 2011, 6:35:16 PM1/7/11
to seleniu...@googlegroups.com
Bob,

thanks so much i tried copying selenium.pm which is around 91kb from perl client driver to c:camelbox/site/lib/test/www/

i get below error

C:\camelbox\bin>PERL gtest.PL
Can't locate object method "new" via package "Test::WWW::Selenium" (perhaps you
forgot to load "Test::WWW::Selenium"?) at gtest.PL line 8.
# Looks like your test died before it could output anything.

any advice would be of great help

Thanks.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.


naveen v

unread,
Jan 8, 2011, 3:52:53 PM1/8/11
to seleniu...@googlegroups.com
Hi Bob

Thanks so much 

I am able to successfully install selenium RC and run test script in Perl

Best regards
Venkata 

Bob McConnell

unread,
Jan 10, 2011, 8:40:28 AM1/10/11
to seleniu...@googlegroups.com
From: naveen v

> Thanks so much
>
> I am able to successfully install selenium RC and run test script in
Perl
>

> On Fri, Jan 7, 2011 at 11:35 PM, naveen v
<venkata...@googlemail.com> wrote:
>>
>>
>> thanks so much i tried copying selenium.pm which is around 91kb
>> from perl client driver to c:camelbox/site/lib/test/www/
>>
>> i get below error
>>
>> C:\camelbox\bin>PERL gtest.PL
>> Can't locate object method "new" via package
"Test::WWW::Selenium" (perhaps you
>> forgot to load "Test::WWW::Selenium"?) at gtest.PL line 8.
>> # Looks like your test died before it could output anything.
>>
>> any advice would be of great help

> > Need your help, if the script above was sufficient
then why do I face
> > compilation error at line 4?
>
> It is looking for selenium.pm in
C:\camelbox\site\lib\Test\WWW\, which
> is where it is installed on my system. Is that module
installed on
> yours?
>
> Also, if the pm file in the Selenium client library is
newer than the
> one installed from CPAN, replace the installed file with
the newer one.
> CPAN had not been updated with that release the last
time I checked.

What were the final steps to get it running?

You might find a few more ideas about using Se with Perl on the Wiki
page I wrote at
<http://wiki.openqa.org/display/SRC/Selenium+RC+and+Perl>. You are
welcome to add your own thoughts and suggestions there.

There is also a blog at
<http://quicksilver1183.com/2010/09/07/setting-up-selenium-with-perl/>
you may find useful.

Bob McConnell

Reply all
Reply to author
Forward
0 new messages