@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 ***");
  }
Example #2
0
  /**
   * Method to start selenium server
   *
   * @author Gaurav Bansal
   */
  public void startSeleniumServer() {
    logger.info("Starting Selenium Server.........This might take around 10-15 seconds.");
    RemoteControlConfiguration rcc = new RemoteControlConfiguration();
    rcc.setPort(4444);
    rcc.setTimeoutInSeconds(600);
    rcc.setSingleWindow(false);

    rcc.setFirefoxProfileTemplate(
        new File(ConfigFileReader.getConfigItemValue("selenium.firefox.profile")));
    // rcc.setAvoidProxy(true);
    rcc.setTrustAllSSLCertificates(true);

    try {
      server = new SeleniumServer(false, rcc);
      server.boot();

    } catch (Exception e) {
      logger.info(e.getMessage());
      logger.info("Server is already running so reusing that.....");
    }
  }
  @BeforeSuite(alwaysRun = true)
  public void setupBeforeSuite(ITestContext context) {
    String seleniumHost = "localhost";
    String seleniumPort = "9080";
    String seleniumBrowser = "firefox";
    String seleniumUrl = "http://localhost:8080/molgenis_apps/";

    RemoteControlConfiguration rcc = new RemoteControlConfiguration();
    rcc.setSingleWindow(true);
    rcc.setPort(Integer.parseInt(seleniumPort));

    try {
      server = new SeleniumServer(false, rcc);
      server.boot();
    } catch (Exception e) {
      throw new IllegalStateException("Can't start selenium server", e);
    }

    proc =
        new HttpCommandProcessor(
            seleniumHost, Integer.parseInt(seleniumPort), seleniumBrowser, seleniumUrl);
    selenium = new DefaultSelenium(proc);
    selenium.start();
  }
 protected static void startJettyProxy() throws Exception {
   RemoteControlConfiguration config = new RemoteControlConfiguration();
   config.setPort(SELENIUM_SERVER_PORT);
   jettyProxy = new SeleniumServer(config);
   jettyProxy.start();
 }