Avoid browser closing on selenium RC shutdown
Page 1 of 1 • Share •
Avoid browser closing on selenium RC shutdown
Hi All,
I am using java/Selenium RC for testing. I start the selenium server programatically and i find that whenever an exception occurs or when the execution of a test case is completed, the browser gets closed. What can be done to have the browser opened?
I googled to find there is a property auto_stop. IT is mentioned that if it is by default set to true, and if it is made as false we can avoid the browser closing. But am not able to figure out where and how i can alter this property. Can someone plz let me know on this?
I am using java/Selenium RC for testing. I start the selenium server programatically and i find that whenever an exception occurs or when the execution of a test case is completed, the browser gets closed. What can be done to have the browser opened?
I googled to find there is a property auto_stop. IT is mentioned that if it is by default set to true, and if it is made as false we can avoid the browser closing. But am not able to figure out where and how i can alter this property. Can someone plz let me know on this?
Divya J- Posts: 2
Join date: 2011-02-28
Re: Avoid browser closing on selenium RC shutdown
In your project code you have a command like:
selenium.Stop();
comment this, and hopefully browser will remains open.
bye!
selenium.Stop();
comment this, and hopefully browser will remains open.
bye!

selenium.testing07- Regular Participant

- Posts: 26
Join date: 2010-11-20
Re: Avoid browser closing on selenium RC shutdown
I dont have any such line to stop the selenium server.
Divya J- Posts: 2
Join date: 2011-02-28
Re: Avoid browser closing on selenium RC shutdown
This is in C# here:
public void TeardownTest()
{
try
{
selenium.Stop();
Can you copy your java code here?
will try to let you know.
it must be there like that.
public void TeardownTest()
{
try
{
selenium.Stop();
Can you copy your java code here?
will try to let you know.
it must be there like that.

selenium.testing07- Regular Participant

- Posts: 26
Join date: 2010-11-20
Re: Avoid browser closing on selenium RC shutdown
Sorry to interrupt the conversation, but is there a way to avoid this behaviour as well for Selenium perl test cases?
Nicolae- Posts: 3
Join date: 2011-03-09
Re: Avoid browser closing on selenium RC shutdown
Its ok Nicolae!
You need to remove or comment this command in your perl code:
$sel->stop();
Let me know, if not work.
Thanks
You need to remove or comment this command in your perl code:
$sel->stop();
Let me know, if not work.
Thanks

selenium.testing07- Regular Participant

- Posts: 26
Join date: 2010-11-20
Re: Avoid browser closing on selenium RC shutdown
I dont' have that line in my test case code, where do you mean I have to remove it from?
Thanks in advance!
Thanks in advance!
Nicolae- Posts: 3
Join date: 2011-03-09
Re: Avoid browser closing on selenium RC shutdown
if its not there.....then it should not stop automatically.
Can you copy your whole code here?
Can you copy your whole code here?
Last edited by selenium.testing07 on Wed Mar 09, 2011 5:53 pm; edited 1 time in total (Reason for editing : other)

selenium.testing07- Regular Participant

- Posts: 26
Join date: 2010-11-20
Re: Avoid browser closing on selenium RC shutdown
use strict;
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*chrome",
browser_url => "http://wpre1" );
#genera DNI
my $range = 90000000;
my $minimum = 9999999;
my $random = int(rand($range)) + $minimum;
sub LetraDNI {
my $numbers = shift;
return substr( 'TRWAGMYFPDXBNJZSQVHLCKE', $numbers % 23, 1);
}
my $letter = LetraDNI ($random);
my $DNI = $random.$letter;
#FIN GENERAR DNI
my $password = "password";
#AƱade DNI al email
my $email = "name.lastname+" . $DNI . '@mail.es';
my $nombre = "Nombre";
my $apellido = "Apellido";
my $calle = "Palma";
my $CP = "28288";
my $poblacion = "Madrid";
my $telefono = "666999666";
$sel->open_ok("registrationform.do");
$sel->click_ok("//input[\@name='idtype' and \@value='1']");
$sel->type_ok("id", $DNI);
$sel->type_ok("identifier=registration-login-table-password", $password);
$sel->type_ok("confirmationpassword", $password);
$sel->type_ok("identifier=registration-login-table-email", $email);
$sel->type_ok("identifier=registration-login-table-confirmation-email", $email);
$sel->select_ok("//select[\@name='treatment']", "label=Sr.");
$sel->type_ok("identifier=firstname2", $nombre);
$sel->type_ok("identifier=lastname12", $apellido);
$sel->type_ok("identifier=lastname22", $apellido);
$sel->select_ok("//select[\@name='dayBirth']", "label=31");
$sel->select_ok("//select[\@name='monthBirth']", "label=Diciembre");
$sel->select_ok("//select[\@name='yearBirth']", "label=1990");
$sel->type_ok("identifier=street2", "Callejuela");
$sel->type_ok("identifier=zipcode2", "28028");
$sel->select_ok("//select[\@name='province']", "label=Madrid");
$sel->type_ok("identifier=city2", $poblacion);
$sel->type_ok("identifier=phonenumber2", $telefono);
$sel->type_ok("mobilephone", $telefono);
$sel->click_ok("readRules");
$sel->click_ok("submitButton");
use warnings;
use Time::HiRes qw(sleep);
use Test::WWW::Selenium;
use Test::More "no_plan";
use Test::Exception;
my $sel = Test::WWW::Selenium->new( host => "localhost",
port => 4444,
browser => "*chrome",
browser_url => "http://wpre1" );
#genera DNI
my $range = 90000000;
my $minimum = 9999999;
my $random = int(rand($range)) + $minimum;
sub LetraDNI {
my $numbers = shift;
return substr( 'TRWAGMYFPDXBNJZSQVHLCKE', $numbers % 23, 1);
}
my $letter = LetraDNI ($random);
my $DNI = $random.$letter;
#FIN GENERAR DNI
my $password = "password";
#AƱade DNI al email
my $email = "name.lastname+" . $DNI . '@mail.es';
my $nombre = "Nombre";
my $apellido = "Apellido";
my $calle = "Palma";
my $CP = "28288";
my $poblacion = "Madrid";
my $telefono = "666999666";
$sel->open_ok("registrationform.do");
$sel->click_ok("//input[\@name='idtype' and \@value='1']");
$sel->type_ok("id", $DNI);
$sel->type_ok("identifier=registration-login-table-password", $password);
$sel->type_ok("confirmationpassword", $password);
$sel->type_ok("identifier=registration-login-table-email", $email);
$sel->type_ok("identifier=registration-login-table-confirmation-email", $email);
$sel->select_ok("//select[\@name='treatment']", "label=Sr.");
$sel->type_ok("identifier=firstname2", $nombre);
$sel->type_ok("identifier=lastname12", $apellido);
$sel->type_ok("identifier=lastname22", $apellido);
$sel->select_ok("//select[\@name='dayBirth']", "label=31");
$sel->select_ok("//select[\@name='monthBirth']", "label=Diciembre");
$sel->select_ok("//select[\@name='yearBirth']", "label=1990");
$sel->type_ok("identifier=street2", "Callejuela");
$sel->type_ok("identifier=zipcode2", "28028");
$sel->select_ok("//select[\@name='province']", "label=Madrid");
$sel->type_ok("identifier=city2", $poblacion);
$sel->type_ok("identifier=phonenumber2", $telefono);
$sel->type_ok("mobilephone", $telefono);
$sel->click_ok("readRules");
$sel->click_ok("submitButton");
Nicolae- Posts: 3
Join date: 2011-03-09
Re: Avoid browser closing on selenium RC shutdown
In java you can avoid the line - selenium.close()
Selenium.close() - closes the browser
selenium.stop() - closes the RC log window
For selenium training, please go to my site - www.sejsoft.com
Selenium.close() - closes the browser
selenium.stop() - closes the RC log window
For selenium training, please go to my site - www.sejsoft.com
auto_ashish1- Active particpant

- Posts: 21
Join date: 2011-03-10
Similar topics» Aery Soul closing
» Avoid browser closing on selenium RC shutdown
» How to open new window or new tab in browser using Selenium IDE
» How can I get the XML document source displayed in browser using selenium
» Running Selenium RC on a server with no graphics card
» Avoid browser closing on selenium RC shutdown
» How to open new window or new tab in browser using Selenium IDE
» How can I get the XML document source displayed in browser using selenium
» Running Selenium RC on a server with no graphics card
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
» sample webdriver code for php users
» which standalone server to use
» Dynamic Drop Down Selection
» It is possible to find list of all URL's exist in any web page in selenium ide
» It is possible to compare 2 same images in selenium IDE.
» how to compare 2 ULR's which is exist in same web page (View page source).
» Web Driver: Unable to click a link present inside the frame of a frameset
» Help me to get dynamicaly loaded options of dropdown in Selenium RC -Junit test case