Test::WWW::Selenium can't start Firefox

277 views
Skip to first unread message

Nigel Horne

unread,
Mar 26, 2010, 12:07:59 PM3/26/10
to Selenium Users
I am on Debian 5.0 x86_64. The following scenario works fine on my
32bit Fedora Core 12 machine. Can anyone help? I really don't know how
to proceed.

Terminal session 1: run java -jar selenium-server.jar

Terminal session 2: run a small perl script thus

#!/usr/bin/perl -w

use strict;
use warnings;
use diagnostics;
use Test::WWW::Selenium;

my $s = Test::WWW::Selenium->new(
host => 'localhost',
port => 4444,
browser => '*firefox',
browser_url => 'http://www.google.com',
default_names => 1
);

The perl script fails
Fetching
http://localhost:4444/selenium-server/driver/?cmd=getNewBrowserSession&1=*firefox&2=http%3A%2F%2Fsandbox.localstars.com%2F
unchanged from server.
Uncaught exception from user code:
Error requesting
http://localhost:4444/selenium-server/driver/?cmd=getNewBrowserSession&1=*firefox&2=http%3A%2F%2Fsandbox.localstars.com%2F:
Failed to start new browser session: Error while launching browser
at /usr/local/share/perl/5.10.1/WWW/Selenium.pm line 485
WWW::Selenium::do_command('Test::WWW::Selenium=HASH(0x20ddb68)',
'getNewBrowserSession', '*firefox', 'http://sandbox.localstars.com/')
called at /usr/local/share/perl/5.10.1/WWW/Selenium.pm line 504
WWW::Selenium::get_string('Test::WWW::Selenium=HASH(0x20ddb68)',
'getNewBrowserSession', '*firefox', 'http://sandbox.localstars.com/')
called at /usr/local/share/perl/5.10.1/WWW/Selenium.pm line 430
WWW::Selenium::start('Test::WWW::Selenium=HASH(0x20ddb68)') called
at /usr/local/share/perl/5.10.1/Test/WWW/Selenium.pm line 209
Test::WWW::Selenium::new('Test::WWW::Selenium', 'host', 'localhost',
'port', 4444, 'browser', '*firefox', 'browser_url',
'http://sandbox.localstars.com/', ...) called at ./loginandlogout line 24

Terminal session 1:

I see this error:

15:55:28.613 INFO - Checking Resource aliases
15:55:28.618 INFO - Command request: getNewBrowserSession[*firefox,
http://sandbox.localstars.com/] on session null
15:55:28.622 INFO - creating new remote session
15:55:28.751 WARN - Caution: '/usr/bin/firefox': file is a script file,
not a real executable. The browser environment is no longer fully under
RC control
15:55:28.760 INFO - Allocated session db99e0fc271c479caecc953e1d1d4daa
for http://sandbox.localstars.com/, launching...
15:55:28.765 ERROR - Failed to start new browser session, shutdown
browser and clear all session data
java.lang.IllegalArgumentException: URI "file:selenium-server.jar" is
not hierarchical
at java.io.File.<init>(libgcj.so.10)
at
org.openqa.selenium.server.browserlaunchers.ResourceExtractor.getJarFileFromUrl(ResourceExtractor.java:101)
at
org.openqa.selenium.server.browserlaunchers.ResourceExtractor.extractResourcePath(ResourceExtractor.java:42)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.extractProfileFromJar(FirefoxChromeLauncher.java:164)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.makeCustomProfile(FirefoxChromeLauncher.java:204)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch(FirefoxChromeLauncher.java:90)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession(FirefoxChromeLauncher.java:400)
at
org.openqa.selenium.server.browserlaunchers.FirefoxLauncher.launchRemoteSession(FirefoxLauncher.java:98)
at
org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession(BrowserSessionFactory.java:372)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:124)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession(BrowserSessionFactory.java:86)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession(SeleniumDriverResourceHandler.java:733)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:399)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:370)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:129)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1530)
at org.openqa.jetty.http.HttpContext.handle(HttpContext.java:1482)
at org.openqa.jetty.http.HttpServer.service(HttpServer.java:909)
at org.openqa.jetty.http.HttpConnection.service(HttpConnection.java:820)
at
org.openqa.jetty.http.HttpConnection.handleNext(HttpConnection.java:986)
at org.openqa.jetty.http.HttpConnection.handle(HttpConnection.java:837)
at
org.openqa.jetty.http.SocketListener.handleConnection(SocketListener.java:245)
at org.openqa.jetty.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.openqa.jetty.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
15:55:28.803 INFO - Got result: Failed to start new browser session:
Error while launching browser on session null

Bindu Laxminarayan

unread,
Mar 26, 2010, 1:50:17 PM3/26/10
to Selenium Users
I see that there is a warning for the path .

WARN - Caution: '/usr/bin/firefox': file is a script file,
not a real executable. The browser environment is no longer fully
under
RC control

Check whether the firefox executable path is correctly added to your
path environment variable.

Thanks
Bindu Laxminarayan

On Mar 26, 11:07 am, Nigel Horne <n...@bandsman.co.uk> wrote:
> I am on Debian 5.0 x86_64.  The following scenario works fine on my
> 32bit Fedora Core 12 machine.  Can anyone help?  I really don't know how
> to proceed.
>
> Terminal session 1: run java -jar selenium-server.jar
>
> Terminal session 2: run a small perl script thus
>
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
> use diagnostics;
> use Test::WWW::Selenium;
>
> my $s = Test::WWW::Selenium->new(
>     host => 'localhost',
>     port => 4444,
>     browser => '*firefox',
>     browser_url => 'http://www.google.com',
>     default_names => 1
> );
>
> The perl script fails

> Fetchinghttp://localhost:4444/selenium-server/driver/?cmd=getNewBrowserSessio...


> unchanged from server.
> Uncaught exception from user code:

>     Error requestinghttp://localhost:4444/selenium-server/driver/?cmd=getNewBrowserSessio...


> Failed to start new browser session: Error while launching browser
>  at /usr/local/share/perl/5.10.1/WWW/Selenium.pm line 485
>     WWW::Selenium::do_command('Test::WWW::Selenium=HASH(0x20ddb68)',
> 'getNewBrowserSession', '*firefox', 'http://sandbox.localstars.com/')
> called at /usr/local/share/perl/5.10.1/WWW/Selenium.pm line 504
>     WWW::Selenium::get_string('Test::WWW::Selenium=HASH(0x20ddb68)',
> 'getNewBrowserSession', '*firefox', 'http://sandbox.localstars.com/')
> called at /usr/local/share/perl/5.10.1/WWW/Selenium.pm line 430
>     WWW::Selenium::start('Test::WWW::Selenium=HASH(0x20ddb68)') called
> at /usr/local/share/perl/5.10.1/Test/WWW/Selenium.pm line 209
>     Test::WWW::Selenium::new('Test::WWW::Selenium', 'host', 'localhost',
> 'port', 4444, 'browser', '*firefox', 'browser_url',
> 'http://sandbox.localstars.com/', ...) called at ./loginandlogout line 24
>
> Terminal session 1:
>
> I see this error:
>
> 15:55:28.613 INFO - Checking Resource aliases

> 15:55:28.618 INFO - Command request: getNewBrowserSession[*firefox,http://sandbox.localstars.com/] on session null


> 15:55:28.622 INFO - creating new remote session
> 15:55:28.751 WARN - Caution: '/usr/bin/firefox': file is a script file,
> not a real executable.  The browser environment is no longer fully under
> RC control
> 15:55:28.760 INFO - Allocated session db99e0fc271c479caecc953e1d1d4daa

> forhttp://sandbox.localstars.com/, launching...

Nigel Horne

unread,
Mar 27, 2010, 4:24:45 AM3/27/10
to seleniu...@googlegroups.com
Bindu Laxminarayan wrote:
> I see that there is a warning for the path .
>
> WARN - Caution: '/usr/bin/firefox': file is a script file,
> not a real executable. The browser environment is no longer fully
> under
> RC control
>
> Check whether the firefox executable path is correctly added to your
> path environment variable.
>
Yes it is (I wouldn't be able to get very far without /usr/bin in my
path :-) )

BTW, in the FC12 machine, on which it works perfectly, /usr/bin/firefox
is also a script file, and Selenium has no problems with it there.
> Thanks
> Bindu Laxminarayan
>
Thanks,

-Nigel

Reply all
Reply to author
Forward
0 new messages