Java 类org.openqa.selenium.server.SeleniumServer 实例源码

项目:eid-applet    文件:AppletTest.java   
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);
}
项目:greenpepper    文件:SeleniumSystemUnderDevelopmentTest.java   
@Override
protected void setUp() throws Exception {
    super.setUp();

    RemoteControlConfiguration configuration = new RemoteControlConfiguration();
    configuration.setPort(4433);

    seleniumServer = new SeleniumServer(configuration);
    seleniumServer.start();
}
项目:sulfur    文件:SWebDriverFactoryAndSeleniumHubTest.java   
@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();
    }
}
项目:grid-acolyte    文件:CustomServerLauncher.java   
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();
}
项目:testing-tools    文件:WebDriverManager.java   
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...");
        }
    }
}
项目:Prospero    文件:SeleniumProxySingleton.java   
protected static void startJettyProxy(int port) throws Exception {
RemoteControlConfiguration config = new RemoteControlConfiguration();
config.setPort(port);
config.setEnsureCleanSession(true);
jettyProxyInstance = new SeleniumServer(config);
jettyProxyInstance.start();
   }
项目:OASIS-Maven    文件:SeleneseScriptFixture.java   
public void startServer() throws Exception {
    RemoteControlConfiguration configuration = new RemoteControlConfiguration();
    configuration.setProxyInjectionModeArg(true);
    configuration.setPort(4444);

    remoteControl = new SeleniumServer(configuration);
    remoteControl.start();
}
项目:cloudstack    文件:AbstractSeleniumTestCase.java   
@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 ***");
}
项目:greenpepper    文件:SeleniumInterpreter.java   
private void stop(SeleniumServer seleniumServer)
  {
      if (seleniumServer == null) return;

seleniumServer.stop();
  }