Subject: | Simple test fails to start firefox |
This is my sample program:
#!/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
);
When I run I get this error:
Uncaught exception from user code:
Error requesting
http://localhost:4444/selenium-server/driver/?cmd=getNe
wBrowserSession&1=*firefox&2=http%3A%2F%2Fwww.google.com:
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(0x13733b8)',
'getNew
BrowserSession', '*firefox', 'http://www.google.com') called at
/usr/local/share
/perl/5.10.1/WWW/Selenium.pm line 504
WWW::Selenium::get_string('Test::WWW::Selenium=HASH(0x13733b8)',
'getNew
BrowserSession', '*firefox', 'http://www.google.com') called at
/usr/local/share
/perl/5.10.1/WWW/Selenium.pm line 430
WWW::Selenium::start('Test::WWW::Selenium=HASH(0x13733b8)')
called at /u
sr/local/share/perl/5.10.1/Test/WWW/Selenium.pm line 209
Test::WWW::Selenium::new('Test::WWW::Selenium', 'host',
'localhost', 'po
rt', 4444, 'browser', '*firefox', 'browser_url',
'http://www.google.com', ...) c
alled at ./loginandlogout line 10
shell returned 255
And I get this error on the Selenium server:
10:21:31.963 INFO - Command request: getNewBrowserSession[*firefox,
http://www.google.com] on session null
10:21:31.968 INFO - creating new remote session
10:21:32.094 WARN - Caution: '/usr/bin/firefox': file is a script file,
not a real executable. The browser environment is no longer fully under
RC control
10:21:32.103 INFO - Allocated session 44cd0c79f4fc455ea92b9e51efeabcaf
for http://www.google.com, launching...
10:21:32.108 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)
10:21:32.146 INFO - Got result: Failed to start new browser session:
Error while launching browser on session null