Difference between defaultselenium.shutdownseleniumserver and seleniumserver.stop

316 views
Skip to first unread message

Arian

unread,
Oct 18, 2011, 8:52:51 AM10/18/11
to Selenium Users
1) What is the difference between
defaultSelenium.shutDownSeleniumServer() and seleniumServer.stop() ? I
observe that when I just use

defaultSelenium.stop();
seleniumServer.stop();
the browser closes but the server does not shut down. If that is the
case, what is the use of seleniumServer.stop()?

2) Is this the right sequence of commands? If not, what is and why?

defaultSelenium.stop();
defaultSelenium.shutDownSeleniumServer();
seleniumServer.stop();

Ross Patterson

unread,
Oct 18, 2011, 10:03:22 AM10/18/11
to seleniu...@googlegroups.com
1) shutDownSeleniumServer() shuts down the server. Obviously that also terminates any active sessions. stop() just terminates the specified session.

2) That looks odd. After shutDownSeleniumServer() completes (which may happen *after* it returns to you), the next stop() is going to fail somehow.

Ross

Krishnan Mahadevan

unread,
Oct 21, 2011, 12:56:44 PM10/21/11
to seleniu...@googlegroups.com
Ross,
Weirdly I never saw any errors when I attempted the following :)

selenium.shutDownSeleniumServer();

selenium.stop();

@Arian,

Now here's the interesting part.

Assuming that a person started the selenium standalone server using 

java -jar selenium-server-standalone-2.9.0.jar

on the command prompt and then went about instantiating Selenium using

Selenium selenium = new DefaultSelenium("localhost",4444, "*firefox", "http://www.google.com");

and then somewhere down the line in their code they used selenium.shutDownSeleniumServer() this shuts down the selenium server that I spawned from the command prompt.

seleniumServer.stop() essentially kills the programmatically spawned SeleniumServer.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"



--
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.


Reply all
Reply to author
Forward
0 new messages