private void start() throws Exception { RemoteControlConfiguration config = new RemoteControlConfiguration(); int seleniumPort = getFreePort(); LOG.debug("configured selenium port: " + seleniumPort); config.setPort(seleniumPort); this.seleniumServer = new SeleniumServer(config); this.seleniumServer.start(); // int seleniumPort = this.seleniumServer.getPort(); LOG.debug("selenium port: " + this.seleniumServer.getPort()); String browserStartCommand = "*firefox"; this.selenium = new DefaultSelenium("localhost", seleniumPort, browserStartCommand, "http://www.google.be"); LOG.debug("starting selenium..."); this.selenium.start(); LOG.debug("selenium started."); this.selenium.setBrowserLogLevel(SeleniumLogLevels.INFO); }
@Override protected void setUp() throws Exception { super.setUp(); RemoteControlConfiguration configuration = new RemoteControlConfiguration(); configuration.setPort(4433); seleniumServer = new SeleniumServer(configuration); seleniumServer.start(); }
@Override public void run() { try { // Start the Selenium Server System.setProperty("org.openqa.jetty.http.HttpRequest.maxFormContentSize", "0"); mSeleniumServer = new SeleniumServer( false, //< no slow resources RemoteControlLauncher.parseLauncherOptions(new String[] {})); //< options mSeleniumServer.boot(); // Enter in a "while loop" waiting for the Server to be not running anymore mRunning = true; while (mRunning) { /* nothing to do - the Selenium Server is running */} // Stop the actual Selenium server mSeleniumServer.stop(); } catch (Exception e) { e.printStackTrace(); } }
public static void main(String[] args) throws Exception { String file = System.getProperty("selenium.config", "selenium.properties"); Properties properties = new Properties(); properties.load(new FileReader(file)); Map<String, Object> config = new HashMap<>(); for (String key : properties.stringPropertyNames()) { config.put(key, properties.getProperty(key)); } SeleniumServer server = new SeleniumServer(config); server.boot(); }
private static void startSeleniumServer() throws Exception { if (isWebDriverLocal()) { try { ServerSocket serverSocket = new ServerSocket(RemoteControlConfiguration.DEFAULT_PORT); serverSocket.close(); seleniumServer = new SeleniumServer(); seleniumServer.boot(); seleniumServer.start(); } catch (BindException e) { System.out.println("Selenium server already up, will reuse..."); } } }
protected static void startJettyProxy(int port) throws Exception { RemoteControlConfiguration config = new RemoteControlConfiguration(); config.setPort(port); config.setEnsureCleanSession(true); jettyProxyInstance = new SeleniumServer(config); jettyProxyInstance.start(); }
public void startServer() throws Exception { RemoteControlConfiguration configuration = new RemoteControlConfiguration(); configuration.setProxyInjectionModeArg(true); configuration.setPort(4444); remoteControl = new SeleniumServer(configuration); remoteControl.start(); }
@BeforeClass public static void setUp() throws Exception { System.out.println("*** Starting selenium ... ***"); RemoteControlConfiguration seleniumConfig = new RemoteControlConfiguration(); seleniumConfig.setPort(4444); seleniumServer = new SeleniumServer(seleniumConfig); seleniumServer.start(); String host = System.getProperty("myParam", "localhost"); selenium = createSeleniumClient("http://" + host + ":" + "8080/client/"); selenium.start(); System.out.println("*** Started selenium ***"); }
private void stop(SeleniumServer seleniumServer) { if (seleniumServer == null) return; seleniumServer.stop(); }