Selenium RC Server opening for Junit
Is there a way we can start the Seleniu开发者_C百科m RC server without using command prompt?
Also, is there a way of seeing the Log window and Test case window in the same one window?
You may use the following code snippet:
new Thread(new Runnable() {
@Override
public void run()
{
org.openqa.selenium.server.SeleniumServer.main();
}
}, "SeleniumServer").start();
Or much simpler in Groovy:
new Thread({ org.openqa.selenium.server.SeleniumServer.main(); }, "SeleniumServer").start()
This may sound a bit random, but I would suggest using maven to control your build and test process. There is a nice plugin for Selenium in maven that will control the startup/shutdown of the server. Maven will provide you with many other added benefits.
精彩评论