Error launching browser from eclipse plug-in

50 views
Skip to first unread message

Selenium_newbie

unread,
Oct 13, 2009, 3:10:25 AM10/13/09
to selenium-developers
I'm trying to run a selenium RC Java class from an eclipse plug-in.
I'm getting the following error while trying to do so.

Failed to start new browser session, shutdown browser and clear all
session data

java.lang.IllegalArgumentException: URI scheme is not "file"
at java.io.File.<init>(Unknown Source)
at
org.openqa.selenium.server.browserlaunchers.ResourceExtractor.extractResourcePath
(ResourceExtractor.java:46)

I've tried clearing the browser session data and even tried uninstall
and reinstall of Firefox. Once in a while it works and mostly it
doesn't and only ends up with the above error.

Can someone please suggest a solution to this problem.

Thanks.

Mark Collin

unread,
Oct 13, 2009, 5:21:03 AM10/13/09
to selenium-...@googlegroups.com
Are you using a shortcut to the firefox executable, or linking
directly to it?

------------------------------
Mark Collin
Managing Director
Ardesco Solutions Ltd

On 13 Oct 2009, at 08:10, Selenium_newbie <silas.j...@gmail.com>
wrote:
--
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postm...@ardescosolutions.com.

This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.

Selenium_newbie

unread,
Oct 14, 2009, 2:47:03 AM10/14/09
to selenium-developers
I'm directly linking to firefox by setting the browser as *chrome in
setUp() method in the JUnit class.

Please find below the sequence of things I'm trying to do.

1) Record a test case from the Selenium IDE and export that as JUnit
Selenium RC class.
2) Trying to invoke/execute the JUnit class from the eclipse-plugin.

It is while doing the second step, I'm getting the mentioned error.

Thanks

On Oct 13, 2:21 pm, Mark Collin <m...@ardescosolutions.com> wrote:
> Are you using a shortcut to the firefox executable, or linking  
> directly to it?
>
> ------------------------------
> Mark Collin
> Managing Director
> Ardesco Solutions Ltd
>
> On 13 Oct 2009, at 08:10, Selenium_newbie <silas.jonat...@gmail.com>  
> wrote:
>
>
>
>
>
>
>
> > I'm trying to run a selenium RC Java class from an eclipse plug-in.
> > I'm getting the following error while trying to do so.
>
> > Failed to start new browser session, shutdown browser and clear all
> > session data
>
> > java.lang.IllegalArgumentException: URI scheme is not "file"
> >    at java.io.File.<init>(Unknown Source)
> >    at
> > org.openqa.selenium.server.browserlaunchers.ResourceExtractor.extractResour­cePath
> > (ResourceExtractor.java:46)
>
> > I've tried clearing the browser session data and even tried uninstall
> > and reinstall of Firefox. Once in a while it works and mostly it
> > doesn't and only ends up with the above error.
>
> > Can someone please suggest a solution to this problem.
>
> > Thanks.
>
> --
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify postmas...@ardescosolutions.com.
>
> This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.- Hide quoted text -
>
> - Show quoted text -

Robin Jarry

unread,
Nov 4, 2009, 6:19:46 AM11/4/09
to selenium-developers
Hello there

I'm getting the same error than selenium_newbie

here's the full stacktrace :

12:08:56.466 ERROR - Failed to start new browser session, shutdown
browser and clear all session data
java.lang.IllegalArgumentException: URI scheme is not "file"
at java.io.File.<init>(Unknown Source)
at
org.openqa.selenium.server.browserlaunchers.ResourceExtractor.extractResourcePath
(ResourceExtractor.java:46)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.extractProfileFromJar
(FirefoxChromeLauncher.java:144)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.makeCustomProfile
(FirefoxChromeLauncher.java:181)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch
(FirefoxChromeLauncher.java:82)
at
org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRemoteSession
(FirefoxChromeLauncher.java:350)
at
org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession
(BrowserSessionFactory.java:357)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
(BrowserSessionFactory.java:122)
at
org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
(BrowserSessionFactory.java:84)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSession
(SeleniumDriverResourceHandler.java:699)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand
(SeleniumDriverResourceHandler.java:393)
at
org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest
(SeleniumDriverResourceHandler.java:364)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle
(SeleniumDriverResourceHandler.java:125)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
at org.mortbay.http.HttpServer.service(HttpServer.java:909)
at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:
986)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
at org.mortbay.http.SocketListener.handleConnection
(SocketListener.java:245)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
12:08:56.528 INFO - Got result: Failed to start new browser session:
Error while launching browser on session null

The annoying thing is that when I launch the test case directly with
"the launch as JUnit test" in Eclipse, I get no error. Same when I
launch it whithin a main method in the test class.
The problem appears to happen when I call the setUp method from
outside the test class.

Any idea?

Thanks in advance,
Robin

Santiago Suarez Ordoñez

unread,
Nov 9, 2009, 10:46:21 PM11/9/09
to selenium-...@googlegroups.com
Try closing all the browsers before starting the test.

Santiago Suarez Ordoñez
Clients Success Engineer
Sauce Labs Inc
http://saucelabs.com

Selenium_newbie

unread,
Nov 11, 2009, 4:24:16 AM11/11/09
to selenium-developers
Hi,

Yes, I've tried closing all the browsers and even tried uninstall and
install, but the problem still persists.

Any help will be of great value.

Thanks.

On Nov 10, 8:46 am, Santiago Suarez Ordoñez <santi...@gmail.com>
wrote:
> Try closing all the browsers before starting the test.
>
> Santiago Suarez Ordoñez
> Clients Success Engineer
> Sauce Labs Inchttp://saucelabs.com
>
>
>
> On Wed, Nov 4, 2009 at 9:19 AM, Robin Jarry <diabete...@gmail.com> wrote:
>
> > Hello there
>
> > I'm getting the same error than selenium_newbie
>
> > here's the full stacktrace :
>
> > 12:08:56.466 ERROR - Failed to start new browser session, shutdown
> > browser and clear all session data
> > java.lang.IllegalArgumentException: URI scheme is not "file"
> >        at java.io.File.<init>(Unknown Source)
> >        at
>
> > org.openqa.selenium.server.browserlaunchers.ResourceExtractor.extractResour­cePath
> > (ResourceExtractor.java:46)
> >        at
>
> > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.extractPr­ofileFromJar
> > (FirefoxChromeLauncher.java:144)
> >        at
>
> > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.makeCusto­mProfile
> > (FirefoxChromeLauncher.java:181)
> >        at
> > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launch
> > (FirefoxChromeLauncher.java:82)
> >        at
>
> > org.openqa.selenium.server.browserlaunchers.FirefoxChromeLauncher.launchRem­oteSession
> > (FirefoxChromeLauncher.java:350)
> >        at
> > org.openqa.selenium.server.BrowserSessionFactory.createNewRemoteSession
> > (BrowserSessionFactory.java:357)
> >        at
> > org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
> > (BrowserSessionFactory.java:122)
> >        at
> > org.openqa.selenium.server.BrowserSessionFactory.getNewBrowserSession
> > (BrowserSessionFactory.java:84)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.getNewBrowserSessi­on
> > (SeleniumDriverResourceHandler.java:699)
> >        at
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand
> > (SeleniumDriverResourceHandler.java:393)
> >        at
>
> > org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandReque­st
> > (SeleniumDriverResourceHandler.java:364)
> >        at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle
> > (SeleniumDriverResourceHandler.java:125)
> >        at org.mortbay.http.HttpContext.handle(HttpContext.java:1530)
> >        at org.mortbay.http.HttpContext.handle(HttpContext.java:1482)
> >        at org.mortbay.http.HttpServer.service(HttpServer.java:909)
> >        at org.mortbay.http.HttpConnection.service(HttpConnection.java:820)
> >        at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:
> > 986)
> >        at org.mortbay.http.HttpConnection.handle(HttpConnection.java:837)
> >        at org.mortbay.http.SocketListener.handleConnection
> > (SocketListener.java:245)
> >        at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
> >        at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)
> > 12:08:56.528 INFO - Got result: Failed to start new browser session:
> > Error while launching browser on session null
>
> > The annoying thing is that when I launch the test case directly with
> > "the launch as JUnit test" in Eclipse, I get no error. Same when I
> > launch it whithin a main method in the test class.
> > The problem appears to happen when I call the setUp method from
> > outside the test class.
>
> > Any idea?
>
> > Thanks in advance,
> > Robin- Hide quoted text -

ma...@ardescosolutions.com

unread,
Nov 11, 2009, 5:01:28 AM11/11/09
to selenium-...@googlegroups.com
Try using profile manager to open up your selenium profile manually and then close it down again.

I'm guessing the browser may have crashed while running your selenium profile and left something behind that is causing the error.  A manual open and close should hopefully fix it (I'm assuming you are keeping your selenium profile when doing a reinstall hence the issue still occurs after reinstall.

i think the command was firefox.exe --profilemanager (assuming a windows box, replace the .exe. with bin for linux)

Regards

Mark

jazoff

unread,
Nov 19, 2009, 3:56:30 PM11/19/09
to selenium-developers
Hey Guys,

I experienced this problem with selenium 1.0 and firefox 3.5 on ubuntu
9.1. To fix it, I hunted down the symbolic link for firefox in /usr/
bin and found that it pointed to an initialization script of some
sort. I knew that unless this script passed over arguments from the
selenium server upon initialization it would break the code (which is
what I thik is happening). So, I went into my selenium code and passed
the direct path to the firefox binary to the DefaultSelenium
constructor (i.e "*firefox /usr/lib/firefox-3.5.5/firefox") and it
worked! Long story short, the browser string "*firefox" will most
likely try to call the "firefox" command from /usr/bin. If this is not
a binary (as selenium expects) you will get an uncaught error.

Jon

QA_manager

unread,
Nov 23, 2009, 10:21:03 AM11/23/09
to selenium-developers
Good catch - please write a defect here: http://code.google.com/p/selenium/issues/list
so it doesn't get lost. I would point out that
http://code.google.com/p/selenium/issues/detail?id=4 is very similar
in concept (although on Windows) and one solution could fix both bugs.
Reply all
Reply to author
Forward
0 new messages