javawindowsseleniumselenium-server

Starting selenium server from java in the background


I want to make easy-to-use selenium tests - just run one file and it starts the server, connects to it, run the tests, then close the server and exit (on windows).

I don't want the user to see the selenium console so I want to hide it if possible (run it in background and maybe log output). How can I start selenium server directly from Java?


Solution

  • Well, it wasn't that hard (at least on windows). I used to start selenium server like this:

    java -jar selenium-server-xxx.jar <options>
    

    To start it without console I just use javaw:

    javaw -jar selenium-server-xxx.jar <options>