Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» how to connect DB in selenium webriver
Fri Oct 06, 2017 4:09 pm by anbarasi

» How find any text in browser screen and click on it?
Thu Oct 05, 2017 2:02 pm by sandeepkommineni

» Selenium Webdriver
Tue Oct 03, 2017 1:35 pm by PiyushBiswas

» GRID setup tutorial.
Wed Sep 27, 2017 4:29 pm by johnyapp

» Drag & Drop Between Windows Using Selenium Driver
Wed Sep 27, 2017 2:10 pm by 26rondel

» Check if window is closed / verify input
Sat Sep 23, 2017 10:21 pm by brainstir

» How to work on pages with AJAX in selenium?
Mon Sep 18, 2017 6:08 pm by azharuddin

» pause test until user press a key like F2
Wed Aug 09, 2017 11:10 pm by djnforce

» Selecting the input for auto populating element
Sat Jul 29, 2017 7:53 pm by kdabbara

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Avoid browser closing on selenium RC shutdown

View previous topic View next topic Go down

Avoid browser closing on selenium RC shutdown

Post by Divya J on Mon Feb 28, 2011 6:05 pm

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?

Divya J

Posts : 2
Join date : 2011-02-28

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by selenium.testing07 on Mon Feb 28, 2011 6:21 pm

In your project code you have a command like:
selenium.Stop();

comment this, and hopefully browser will remains open.

bye!
avatar
selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by Divya J on Mon Feb 28, 2011 6:44 pm

I dont have any such line to stop the selenium server.

Divya J

Posts : 2
Join date : 2011-02-28

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by selenium.testing07 on Mon Feb 28, 2011 6:47 pm

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.
avatar
selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by Nicolae on Wed Mar 09, 2011 6:33 pm

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

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by selenium.testing07 on Wed Mar 09, 2011 6:48 pm

Its ok Nicolae!

You need to remove or comment this command in your perl code:

$sel->stop();


Let me know, if not work.


Thanks
avatar
selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by Nicolae on Wed Mar 09, 2011 7:13 pm

I dont' have that line in my test case code, where do you mean I have to remove it from?
Thanks in advance!

Nicolae

Posts : 3
Join date : 2011-03-09

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by selenium.testing07 on Wed Mar 09, 2011 7:22 pm

if its not there.....then it should not stop automatically.

Can you copy your whole code here?


Last edited by selenium.testing07 on Wed Mar 09, 2011 7:23 pm; edited 1 time in total (Reason for editing : other)
avatar
selenium.testing07
Regular Participant
Regular Participant

Posts : 26
Join date : 2010-11-20

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by Nicolae on Wed Mar 09, 2011 7:38 pm

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");

Nicolae

Posts : 3
Join date : 2011-03-09

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by auto_ashish1 on Thu Mar 10, 2011 3:04 pm

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

auto_ashish1
Active particpant
Active particpant

Posts : 21
Join date : 2011-03-10

Back to top Go down

Re: Avoid browser closing on selenium RC shutdown

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum