[selenium-users] Selenium RC closing the browser

1,340 views
Skip to first unread message

srikanth

unread,
Apr 27, 2011, 12:44:45 AM4/27/11
to seleniu...@googlegroups.com

Hi,

 

I am new to Selenium. I have one problem with my selenium. I am using selenium-server-1.0.3, eclipse with testng.  After my script execution the browser is automatically closing.

Even after deletion of “selenium.stop();”  also the browser is closing. So could you please tell me how to stop the browser to auto close.

Script is attached.

 

Thanks

Srikanth

 

 

test.txt

MAYANK SINGHAL

unread,
Apr 27, 2011, 1:01:21 AM4/27/11
to seleniu...@googlegroups.com
When your script has completed, browser is also closed if you want to closed in between test cases, use command selenium.stop ("local host", "browser name","Url address")

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To post to this group, send email to seleniu...@googlegroups.com.
To unsubscribe from this group, send email to selenium-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/selenium-users?hl=en.

srikanth

unread,
Apr 27, 2011, 1:10:43 AM4/27/11
to seleniu...@googlegroups.com

Sorry Mayank, I don’t want to close the browser in between & even after the script done. My requirement is to check the page manually after the script done. The attached script is just an example how I written the script.

NeelakandanRVJ

unread,
Apr 27, 2011, 1:59:16 AM4/27/11
to seleniu...@googlegroups.com
Remove the tear down method from your script.
Please wait while images are being loaded.....by Wowmailz Neelu

AJ

unread,
Apr 27, 2011, 2:04:01 AM4/27/11
to Selenium Users
Srikanth,
Here is my assumption on why the browser is getting closed. testNG/
Selenium experts, please correct me if am wrong

You create the selenium server object using the code. Since you are
executing your test using testNG, testNG will kill all the objects
after the method is complete. And that includes your seleniumserver
and selenium object. Once that object is killed, by default any
process which was started by it also gets killed. Hence your browser
window closes.

If you want to keep the window open, you can do it this way:

Start the selenium server manually from command prompt
Change your code as given below:

@Test
public void testgoogle()throws Exception {
/* RemoteControlConfiguration rc = new RemoteControlConfiguration();
seleniumserver = new SeleniumServer(rc);

seleniumserver.start();*/
selenium = new DefaultSelenium("localhost", 4444, "*firefox",
"http://");
selenium.start();
selenium.open("http://www.gmail.com");
selenium.type("Email", "ckant8");
selenium.type("//*[@id=\"Passwd\"]", "xxxxx");
selenium.click("signIn");
selenium.windowMaximize();

}

That should take care of keeping the browser open.

I don't think this is the best way, but it works.

Thanks
AJ
> <mailto:selenium-users%2Bunsu...@googlegroups.com> .
> For more options, visit this group athttp://groups.google.com/group/selenium-users?hl=en.

srikanth

unread,
Apr 27, 2011, 2:33:39 AM4/27/11
to seleniu...@googlegroups.com
Hi Anand,
It's working fine. Thanks for your help.

R@m$

unread,
Apr 27, 2011, 1:56:30 AM4/27/11
to seleniu...@googlegroups.com
Hi,

Do you have any configuration file with properties/settings? and check if debug_mode is true or false.

If debug_mode= true, the browser will not close automatically
If debug_mode= False, the browser automatically closes after execution.


Thanks,
♞☼  R A M S  ☼♞



On Wed, Apr 27, 2011 at 10:40 AM, srikanth <cka...@gmail.com> wrote:
Reply all
Reply to author
Forward
0 new messages