Skip Menu |

This queue is for tickets about the Test-WWW-Selenium CPAN distribution.

Report information
The Basics
Id: 70592
Status: open
Priority: 0/
Queue: Test-WWW-Selenium

People
Owner: Nobody in particular
Requestors: cpan [...] iijo.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.25
Fixed in: (no value)



Subject: browser processes not cleaned up
The following code causes the browser to keep running even after the test completes. They key part which seems to break everything is the subroutine 'fooey'. use Test::More; use Test::WWW::Selenium; # Parameters are passed through to WWW::Selenium my $sel = Test::WWW::Selenium->new( host => "localhost", port => 4444, browser => "*firefox", browser_url => "http://www.google.com", ); # use special test wrappers around WWW::Selenium commands: $sel->open_ok("http://www.google.com"); $sel->type_ok( "q", "hello world"); done_testing; sub fooey { return $sel->get_location(); } I get no error message. But if you do 'ps awwwux | grep firefox', you will see that the browser is still running. Also, I haven't figured out how to duplicate it, but I think this is related to the above: I sometimes get an error message that looks like this: (in cleanup) Error requesting http://localhost:6543/selenium- server/driver/: 500 Can't call method "FETCH" on an undefined value
If I add '$sel->stop;' at the end of my script the browser session gets cleaned up. This is not in the documentation though. On Mon Aug 29 16:52:26 2011, kablamo wrote: Show quoted text
> The following code causes the browser to keep running even after the > test completes. They key part which seems to break everything is the > subroutine 'fooey'. > > use Test::More; > use Test::WWW::Selenium; > > # Parameters are passed through to WWW::Selenium > my $sel = Test::WWW::Selenium->new( > host => "localhost", > port => 4444, > browser => "*firefox", > browser_url => "http://www.google.com", > ); > > # use special test wrappers around WWW::Selenium commands: > $sel->open_ok("http://www.google.com"); > $sel->type_ok( "q", "hello world"); > > done_testing; > > sub fooey { > return $sel->get_location(); > } > > I get no error message. But if you do 'ps awwwux | grep firefox', you > will see that the browser is still running. > > Also, I haven't figured out how to duplicate it, but I think this is > related to the above: I sometimes get an error message that looks
like Show quoted text
> this: > > (in cleanup) Error requesting http://localhost:6543/selenium- > server/driver/: > 500 Can't call method "FETCH" on an undefined value
Subject: Re: [rt.cpan.org #70592] browser processes not cleaned up
Date: Wed, 31 Aug 2011 08:40:10 -0700
To: bug-Test-WWW-Selenium [...] rt.cpan.org
From: Luke Closs <lukecloss [...] gmail.com>
It's mentioned in the docs for WWW::Selenium - https://metacpan.org/module/WWW::Selenium which is the superclass of Test::WWW::Selenium. Maybe it could be better spelled out in the Test::WWW::Selenium docs. On Wed, Aug 31, 2011 at 8:35 AM, Eric D Johnson via RT <bug-Test-WWW-Selenium@rt.cpan.org> wrote: Show quoted text
>       Queue: Test-WWW-Selenium >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70592 > > > If I add '$sel->stop;' at the end of my script the browser session gets > cleaned up.  This is not in the documentation though. > > On Mon Aug 29 16:52:26 2011, kablamo wrote:
>> The following code causes the browser to keep running even after the >> test completes.  They key part which seems to break everything is the >> subroutine 'fooey'. >> >>     use Test::More; >>     use Test::WWW::Selenium; >> >>     # Parameters are passed through to WWW::Selenium >>     my $sel = Test::WWW::Selenium->new( >>         host        => "localhost", >>         port        => 4444, >>         browser     => "*firefox", >>         browser_url => "http://www.google.com", >>     ); >> >>     # use special test wrappers around WWW::Selenium commands: >>     $sel->open_ok("http://www.google.com"); >>     $sel->type_ok( "q", "hello world"); >> >>     done_testing; >> >>     sub fooey { >>         return $sel->get_location(); >>     } >> >> I get no error message.  But if you do 'ps awwwux | grep firefox', you >> will see that the browser is still running. >> >> Also, I haven't figured out how to duplicate it, but I think this is >> related to the above:  I sometimes get an error message that looks
> like
>> this: >> >>         (in cleanup) Error requesting http://localhost:6543/selenium- >> server/driver/: >> 500 Can't call method "FETCH" on an undefined value
> > > >
Thanks Luke. Yes, stop() is mentioned in WWW::Selenium. But I think there is still a significant bug because my code example shows the autodie feature is broken in WWW::Selenium. I think the autodie feature is important. When I'm running a single test, I want the test to start a browser at the beginning and shutdown at the end. When I'm running a whole suite of tests, I'd like to run all the tests against a single browser instance. This provides a significant speed improvement since I don't have to wait for the browser to restart. If I have to explicitly put a stop() in each test, I can't run a whole suite of tests against a single browser instance. On Wed Aug 31 11:40:20 2011, lukecloss@gmail.com wrote: Show quoted text
> It's mentioned in the docs for WWW::Selenium - > https://metacpan.org/module/WWW::Selenium which is the superclass of > Test::WWW::Selenium. > > Maybe it could be better spelled out in the Test::WWW::Selenium docs. > > On Wed, Aug 31, 2011 at 8:35 AM, Eric D Johnson via RT > <bug-Test-WWW-Selenium@rt.cpan.org> wrote:
> >       Queue: Test-WWW-Selenium > >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70592 > > > > > If I add '$sel->stop;' at the end of my script the browser session
gets Show quoted text
> > cleaned up.  This is not in the documentation though. > > > > On Mon Aug 29 16:52:26 2011, kablamo wrote:
> >> The following code causes the browser to keep running even after
the Show quoted text
> >> test completes.  They key part which seems to break everything is
the Show quoted text
> >> subroutine 'fooey'. > >> > >>     use Test::More; > >>     use Test::WWW::Selenium; > >> > >>     # Parameters are passed through to WWW::Selenium > >>     my $sel = Test::WWW::Selenium->new( > >>         host        => "localhost", > >>         port        => 4444, > >>         browser     => "*firefox", > >>         browser_url => "http://www.google.com", > >>     ); > >> > >>     # use special test wrappers around WWW::Selenium commands: > >>     $sel->open_ok("http://www.google.com"); > >>     $sel->type_ok( "q", "hello world"); > >> > >>     done_testing; > >> > >>     sub fooey { > >>         return $sel->get_location(); > >>     } > >> > >> I get no error message.  But if you do 'ps awwwux | grep firefox',
you Show quoted text
> >> will see that the browser is still running. > >> > >> Also, I haven't figured out how to duplicate it, but I think this
is Show quoted text
> >> related to the above:  I sometimes get an error message that looks
> > like
> >> this: > >> > >>         (in cleanup) Error requesting
http://localhost:6543/selenium- Show quoted text
> >> server/driver/: > >> 500 Can't call method "FETCH" on an undefined value
> > > > > > > >
Subject: Re: [rt.cpan.org #70592] browser processes not cleaned up
Date: Thu, 1 Sep 2011 08:57:01 -0700
To: bug-Test-WWW-Selenium [...] rt.cpan.org
From: Luke Closs <lukecloss [...] gmail.com>
One thing that may work for you is to subclass WWW::Selenium or T::W::S to have the behaviour you want. If you have any patches you'd like to see for fixing the cleanup, please fork https://github.com/lukec/cpan-selenium-rc-perl Luke On Thu, Sep 1, 2011 at 12:54 AM, Eric D Johnson via RT <bug-Test-WWW-Selenium@rt.cpan.org> wrote: Show quoted text
>       Queue: Test-WWW-Selenium >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70592 > > > Thanks Luke.  Yes, stop() is mentioned in WWW::Selenium.  But I think > there is still a significant bug because my code example shows the > autodie feature is broken in WWW::Selenium. > > I think the autodie feature is important.  When I'm running a single > test, I want the test to start a browser at the beginning and shutdown > at the end.  When I'm running a whole suite of tests, I'd like to run > all the tests against a single browser instance.  This provides a > significant speed improvement since I don't have to wait for the browser > to restart. > > If I have to explicitly put a stop() in each test, I can't run a whole > suite of tests against a single browser instance. > > > > > On Wed Aug 31 11:40:20 2011, lukecloss@gmail.com wrote:
>> It's mentioned in the docs for WWW::Selenium - >> https://metacpan.org/module/WWW::Selenium which is the superclass of >> Test::WWW::Selenium. >> >> Maybe it could be better spelled out in the Test::WWW::Selenium docs. >> >> On Wed, Aug 31, 2011 at 8:35 AM, Eric D Johnson via RT >> <bug-Test-WWW-Selenium@rt.cpan.org> wrote:
>> >       Queue: Test-WWW-Selenium >> >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=70592 > >> > >> > If I add '$sel->stop;' at the end of my script the browser session
> gets
>> > cleaned up.  This is not in the documentation though. >> > >> > On Mon Aug 29 16:52:26 2011, kablamo wrote:
>> >> The following code causes the browser to keep running even after
> the
>> >> test completes.  They key part which seems to break everything is
> the
>> >> subroutine 'fooey'. >> >> >> >>     use Test::More; >> >>     use Test::WWW::Selenium; >> >> >> >>     # Parameters are passed through to WWW::Selenium >> >>     my $sel = Test::WWW::Selenium->new( >> >>         host        => "localhost", >> >>         port        => 4444, >> >>         browser     => "*firefox", >> >>         browser_url => "http://www.google.com", >> >>     ); >> >> >> >>     # use special test wrappers around WWW::Selenium commands: >> >>     $sel->open_ok("http://www.google.com"); >> >>     $sel->type_ok( "q", "hello world"); >> >> >> >>     done_testing; >> >> >> >>     sub fooey { >> >>         return $sel->get_location(); >> >>     } >> >> >> >> I get no error message.  But if you do 'ps awwwux | grep firefox',
> you
>> >> will see that the browser is still running. >> >> >> >> Also, I haven't figured out how to duplicate it, but I think this
> is
>> >> related to the above:  I sometimes get an error message that looks
>> > like
>> >> this: >> >> >> >>         (in cleanup) Error requesting
> http://localhost:6543/selenium-
>> >> server/driver/: >> >> 500 Can't call method "FETCH" on an undefined value
>> > >> > >> > >> >
> > > >