[Selenium] Fails to start browser session (Firefox 3, Ubuntu)

76 views
Skip to first unread message

tim

unread,
Jun 23, 2009, 6:43:26 PM6/23/09
to Cukes
Hi,

I'm a bit lost: I tried turning on webrats selenium mode. When I run
rake features the selenium server and the app server are started
correctly. Then a new Firefox instance becomes visible for a fraction
of a second, but then I see this error message:

Scenario: Visit orders page # features/list_orders.feature:6
==> Waiting for Selenium RC server on port 4444... Ready!
==> Waiting for rails application server on port 3001... Ready!
00:26:53.626 ERROR - Failed to start new browser session, shutdown
browser an clear all session data
org.openqa.selenium.server.RemoteCommandException: timed out waiting
for window 'null' to appear ....

I've tried changing the browser key, but no luck there. I have also
created the firefox-bin link as described in the wiki.

Has anyone experienced this error before? Any help would be greatly
appreciated!

Best
Tim

Tim Walker

unread,
Jun 23, 2009, 7:05:14 PM6/23/09
to cu...@googlegroups.com
Did you get the right jar that works with FF3?

See step 2 in..

http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium

Thanks,

Tim

tim

unread,
Jun 23, 2009, 7:13:04 PM6/23/09
to Cukes
Thanks for your quick reply. I used the jar which is bundled up with
webrat. I tried to follow the instructions in the second part of the
github wiki page that you referenced.

Thanks
Tim

On 24 Jun., 01:05, Tim Walker <walke...@gmail.com> wrote:
> Did you get the right jar that works with FF3?
>
> See step 2 in..
>
> http://wiki.github.com/aslakhellesoy/cucumber/setting-up-selenium
>
> Thanks,
>
> Tim
>

Tim Walker

unread,
Jun 23, 2009, 7:40:06 PM6/23/09
to cu...@googlegroups.com
You can tell for sure by extracting (jar tf file.jar) and looking in
the (I think) cfg files where FireFox versionis bound to 2.

As described here:
http://notetodogself.blogspot.com/2008/10/use-selenium-rc-in-firefox-3.html

Good luck!

Tim

tim

unread,
Jun 24, 2009, 3:54:39 AM6/24/09
to Cukes
As much as I hoped this would fix my issue, I'm sorry to say it
didn't. I downloaded the newest version of selenium-server.jar and
replaced it inside the webrat vendor dir. But the error remains the
same. As I said: It does start firefox. But it does not recognize it
for some reason.

Thanks for your help so far. I'm really hitting a wall here.

Any other tip?

On 24 Jun., 01:40, Tim Walker <walke...@gmail.com> wrote:
> You can tell for sure by extracting (jar tf file.jar) and looking in
> the (I think) cfg files where FireFox versionis bound to 2.
>
> As described here:http://notetodogself.blogspot.com/2008/10/use-selenium-rc-in-firefox-...
>
> Good luck!
>
> Tim

Noel_g

unread,
Jun 24, 2009, 11:24:35 AM6/24/09
to Cukes
I am having the same issue. replaced the jar in webrat as well as the
one in the selenium gem.

I'm on OS X 10.5.7

On Jun 24, 12:54 am, tim <fischbach....@googlemail.com> wrote:
> As much as I hoped this would fix my issue, I'm sorry to say it
> didn't. I downloaded the newest version ofselenium-server.jar and
> > >> > I'm a bit lost: I tried turning on webratsseleniummode. When I run
> > >> > rake features theseleniumserver and the app server are started
> > >> > correctly. Then a new Firefox instance becomes visible for a fraction
> > >> > of a second, but then I see this error message:
>
> > >> > Scenario: Visit orders page           # features/list_orders.feature:6
> > >> > ==> Waiting forSeleniumRC server on port 4444... Ready!

tim

unread,
Jun 24, 2009, 4:24:31 PM6/24/09
to Cukes
As a quick hint for everybody who is having the same problem: I think
I found an error in the webrat source that causes this error. In lib/
webrat/selenium/selenium_rc_server.rb in method remote_control change

@remote_control = ::Selenium::RemoteControl::RemoteControl.new
("0.0.0.0",

Webrat.configuration.selenium_server_port,

Webrat.configuration.selenium_browser_startup_timeout)

to

@remote_control = ::Selenium::RemoteControl::RemoteControl.new
("0.0.0.0",

Webrat.configuration.selenium_server_port,
:timeout
=> Webrat.configuration.selenium_browser_startup_timeout)

This seems to be the correct signature of that method. The first
variant results in timeout == 0, so the browser can not start.

If no other issues arise I'll fork the project on github and add the
link here.

tim

unread,
Jun 24, 2009, 4:25:35 PM6/24/09
to Cukes
It messed up my whitespace, but you get the idea...

Noel

unread,
Jun 24, 2009, 4:46:13 PM6/24/09
to cu...@googlegroups.com
I tried doing this

@remote_control =
::Selenium::RemoteControl::RemoteControl.new("0.0.0.0",
Webrat.configuration.selenium_server_port, :timeout =>
Webrat.configuration.selenium_browser_startup_timeout)

but now I get an error

undefined method `selenium_browser_startup_timeout' for
#<Webrat::Configuration:0x223ca4c> (NoMethodError)

Noel

unread,
Jun 24, 2009, 5:04:12 PM6/24/09
to cu...@googlegroups.com
It worked if I set the timeout to 10000, but I now get this even
though the tests pass.

I am starting mongrel like this
script/server -p 3001 -e test

Wendy:yourtogo noel$ cucumber
WARNING: Nokogiri was built against LibXML version 2.6.16, but has
dynamically loaded 2.6.30
Feature: Display Cuisines and associated Restaurants
In order Make it simple to find restaurants
As a guest
I want to see multiple cuisines and restaurants grouped within them

Scenario: Cuisines List #
features/display_cuisines.feature:6
Given I have cuisines named "Chinese", "Mexican" #
features/step_definitions/cuisine_steps.rb:1
==> Waiting for Selenium RC server on port 4444... Ready!


==> Waiting for rails application server on port 3001... Ready!

When I go to the homepage #
features/step_definitions/webrat_steps.rb:10
Then I should see "Chinese" #
features/step_definitions/webrat_steps.rb:93
And I should see "Mexican" #
features/step_definitions/webrat_steps.rb:93

1 scenario (1 passed)
4 steps (4 passed)
0m9.493s
!!! PID file /Users/noel/My_Development_Stuff/yourtogo/tmp/pids/mongrel_selenium.pid
does not exist. Not running?
mongrel::stop reported an error. Use mongrel_rails mongrel::stop -h to get help.
13:58:53.132 ERROR - Exception running '0 'command on session null
java.lang.NullPointerException: sessionId should not be null; has this
session been started yet?
at org.openqa.selenium.server.FrameGroupCommandQueueSet.getQueueSet(FrameGroupCommandQueueSet.java:212)
at org.openqa.selenium.server.commands.SeleniumCoreCommand.execute(SeleniumCoreCommand.java:34)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.doCommand(SeleniumDriverResourceHandler.java:516)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handleCommandRequest(SeleniumDriverResourceHandler.java:368)
at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDriverResourceHandler.java:129)
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:816)
at org.mortbay.http.HttpConnection.handleNext(HttpConnection.java:982)
at org.mortbay.http.HttpConnection.handle(HttpConnection.java:833)
at org.mortbay.http.SocketListener.handleConnection(SocketListener.java:244)
at org.mortbay.util.ThreadedServer.handle(ThreadedServer.java:357)
at org.mortbay.util.ThreadPool$PoolThread.run(ThreadPool.java:534)

tim

unread,
Jun 24, 2009, 6:01:47 PM6/24/09
to Cukes
You should not need to start mongrel manually. This should be part of
the webrat start up process.

tim

unread,
Jun 24, 2009, 6:15:10 PM6/24/09
to Cukes
Ok, I've got it working. Phew! I also had to make the ":timeout => "
change in the stop method in selenium_rc_server.rb.

I'll fork the project on github and insert the link here.

JDS

unread,
Jul 2, 2009, 12:36:35 PM7/2/09
to Cukes
Have you forked the project yet and can we have the link? I've got the
same problem.

Ta

John Small


On 24 June, 23:15, tim <fischbach....@googlemail.com> wrote:
> Ok, I've got it working. Phew! I also had to make the ":timeout => "
> change in the stop method in selenium_rc_server.rb.
>
> I'll fork the project on github and insert the link here.
>
> On 25 Jun., 00:01, tim <fischbach....@googlemail.com> wrote:
>
> > You should not need to start mongrel manually. This should be part of
> > thewebratstart up process.
>
> > On 24 Jun., 23:04, Noel <wwydi...@gmail.com> wrote:
>
> > > It worked if I set the timeout to 10000, but I now get this even
> > > though the tests pass.
>
> > > I am starting mongrel like this
> > > script/server -p 3001 -e test
>
> > > Wendy:yourtogo noel$ cucumber
> > > WARNING: Nokogiri was built against LibXML version 2.6.16, but has
> > > dynamically loaded 2.6.30
> > > Feature: Display Cuisines and associated Restaurants
> > >   In order Make it simple to find restaurants
> > >   As a guest
> > >   I want to see multiple cuisines and restaurants grouped within them
>
> > >   Scenario: Cuisines List                            #
> > > features/display_cuisines.feature:6
> > >     Given I have cuisines named "Chinese", "Mexican" #
> > > features/step_definitions/cuisine_steps.rb:1
> > > ==> Waiting forSeleniumRC server on port 4444... Ready!

Noel

unread,
Jul 2, 2009, 12:44:12 PM7/2/09
to cu...@googlegroups.com
FYI,

I got this working without having to change that timeout. In the end
the cause was selenium-client, don't use 1.2.16, try .15

-Noel

Tim Walker

unread,
Jul 2, 2009, 12:59:05 PM7/2/09
to cu...@googlegroups.com
FWIW - this happened the other day to me but was not this problem. It
was because we added a configuration (offline) that was not added in
one of the yml files (in this case it was for workling). In any event
the console showed the command line to run to isolate this from the
test automated starting. Bottom line, running it directly yielded the
real error as to why the rc server was not loading.

Tim

JDS

unread,
Jul 3, 2009, 9:11:01 AM7/3/09
to Cukes
Sounds interesting, but can you please translate that into English?

On 2 July, 17:59, Tim Walker <walke...@gmail.com> wrote:
> FWIW - this happened the other day to me but was not this problem. It
> was because we added a configuration (offline) that was not added in
> one of the yml files (in this case it was for workling). In any event
> the console showed the command line to run to isolate this from the
> test automated starting. Bottom line, running it directly yielded the
> real error as to why the rc server was not loading.
>
> Tim
>

Brent

unread,
Jul 23, 2009, 2:31:56 PM7/23/09
to Cukes
I downgraded from 1.2.16 to 1.2.15, but I'm still getting this error:

14:27:28.859 ERROR - Failed to start new browser session, shutdown
browser an clear all session data
org.openqa.selenium.server.RemoteCommandException: timed out waiting
for window 'null' to appear

Is there something else that I need to do to get past it?

-Brent

On Jul 2, 12:44 pm, Noel <wwydi...@gmail.com> wrote:
> FYI,
>
> I got this working without having to change that timeout.  In the end
> the cause wasselenium-client, don't use 1.2.16, try .15
> >> > >         at org.openqa.selenium.server.SeleniumDriverResourceHandler.handle(SeleniumDri verResourceHandler.java:129)

Marcelo de Moraes Serpa

unread,
Aug 6, 2009, 5:19:43 PM8/6/09
to cu...@googlegroups.com
Hello -- any news on this? What was the root cause -- the recent
selenium-client gems fix this issue?

Regards,

Marcelo.

Noel

unread,
Aug 6, 2009, 5:41:16 PM8/6/09
to cu...@googlegroups.com
It is working for me with
selenium-client (1.2.15)
and
Firefox 3.0.11

FF 3.5 just sits there when I tried it. Have not tried latest
selenium-client with FF 3.5

Tim Walker

unread,
Aug 6, 2009, 6:37:50 PM8/6/09
to cu...@googlegroups.com
If you unpack the selenium-server.jar in the webrat gem:

jar -xf selenium_server.jar

And then cd to:

customProfileDirCUSTFF/extensions/{538F0036-F358-4f84-A764-89FB437166B4}

And then:

cat install.rdf

Do you see the lines:

<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.4.1</em:minVersion>
<em:maxVersion>3.0.*</em:maxVersion>
</Description>
</em:targetApplication>

You should be able to spot the problem!

Thanks,

Tim

Noel

unread,
Aug 6, 2009, 7:01:01 PM8/6/09
to cu...@googlegroups.com
<!-- Firefox -->
<em:targetApplication>
<Description>
<em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
<em:minVersion>1.4.1</em:minVersion>
<em:maxVersion>3.5.*</em:maxVersion>
</Description>
</em:targetApplication>
Reply all
Reply to author
Forward
0 new messages