Package org.openqa.selenium.server.browserlaunchers

Examples of org.openqa.selenium.server.browserlaunchers.BrowserLauncher


            if (values.size() < 1) {
                results = "ERROR: You must specify a browser";
            } else {
                String browser = values.get(0);
                String newSessionId = generateNewSessionId();
                BrowserLauncher simpleLauncher = browserLauncherFactory.getBrowserLauncher(browser, newSessionId, remoteControl.getConfiguration());
                String baseUrl = "http://localhost:" + remoteControl.getPort();
                remoteControl.registerBrowserSession(new BrowserSessionInfo(
                    newSessionId, browser, baseUrl, simpleLauncher, null));
                simpleLauncher.launchHTMLSuite("TestPrompt.html?thisIsSeleniumServer=true", baseUrl, false, "info");
                results = "OK";
            }
        } else if ("slowResources".equals(cmd)) {
            String arg = values.get(0);
            boolean setting = true;
View Full Code Here


        String extensionJs, BrowserConfigurationOptions browserConfiguration, boolean ensureClean, RemoteControlConfiguration configuration)
        throws RemoteCommandException {

        final FrameGroupCommandQueueSet queueSet;
        final BrowserSessionInfo sessionInfo;
        final BrowserLauncher launcher;
        final String sessionId;

        sessionId = UUID.randomUUID().toString().replace("-", "");
        queueSet = makeQueueSet(sessionId, configuration.getPortDriversShouldContact(), configuration);
        queueSet.setExtensionJs(extensionJs);
       
        try {
          launcher = browserLauncherFactory.getBrowserLauncher(browserString, sessionId, configuration);
        } catch (InvalidBrowserExecutableException e) {
          throw new RemoteCommandException(e.getMessage(), "");
        }
       
        sessionInfo = new BrowserSessionInfo(sessionId, browserString, startURL, launcher, queueSet);
        SeleniumDriverResourceHandler.setLastSessionId(sessionId);
        LOGGER.info("Allocated session " + sessionId + " for " + startURL + ", launching...");

        try {
            launcher.launchRemoteSession(startURL, configuration.isMultiWindow(), browserConfiguration);
            queueSet.waitForLoad(configuration.getTimeoutInSeconds() * 1000l);

            // TODO DGF log4j only
            // NDC.push("sessionId="+sessionId);
            FrameGroupCommandQueueSet queue = getQueueSet(sessionId);
View Full Code Here

            timeoutInMs = Long.MAX_VALUE;
        }
        remoteControl.handleHTMLRunnerResults(this);
        BrowserLauncherFactory blf = new BrowserLauncherFactory();
        String sessionId = Long.toString(System.currentTimeMillis() % 1000000);
        BrowserLauncher launcher = blf.getBrowserLauncher(browser, sessionId, remoteControl.getConfiguration());
        BrowserSessionInfo sessionInfo = new BrowserSessionInfo(sessionId,
            browser, browserURL, launcher, null);
        remoteControl.registerBrowserSession(sessionInfo);
       
        // JB: -- aren't these URLs in the wrong order according to declaration?
        launcher.launchHTMLSuite(suiteURL, browserURL, multiWindow, defaultLogLevel);
        long now = System.currentTimeMillis();
        long end = now + timeoutInMs;
        while (results == null && System.currentTimeMillis() < end) {
            AsyncExecute.sleepTight(500);
        }
        launcher.close();
        remoteControl.deregisterBrowserSession(sessionInfo);
        if (results == null) {
            throw new SeleniumCommandTimedOutException();
        }
        if (outputFile != null) {
View Full Code Here

        String extensionJs, BrowserConfigurationOptions browserConfiguration, boolean ensureClean, RemoteControlConfiguration configuration)
        throws RemoteCommandException {

        final FrameGroupCommandQueueSet queueSet;
        final BrowserSessionInfo sessionInfo;
        final BrowserLauncher launcher;
        final String sessionId;

        sessionId = UUID.randomUUID().toString().replace("-", "");
        queueSet = makeQueueSet(sessionId, configuration.getPortDriversShouldContact(), configuration);
        queueSet.setExtensionJs(extensionJs);
       
        try {
          launcher = browserLauncherFactory.getBrowserLauncher(browserString, sessionId, configuration, browserConfiguration);
        } catch (InvalidBrowserExecutableException e) {
          throw new RemoteCommandException(e.getMessage(), "");
        }
       
        sessionInfo = new BrowserSessionInfo(sessionId, browserString, startURL, launcher, queueSet);
        SeleniumDriverResourceHandler.setLastSessionId(sessionId);
        LOGGER.info("Allocated session " + sessionId + " for " + startURL + ", launching...");
               
        LoggingManager.perSessionLogHandler().setThreadToSessionMapping(Thread.currentThread().getId(), sessionId);
        LoggingManager.perSessionLogHandler().copyThreadTempLogsToSessionLogs(sessionId, Thread.currentThread().getId());
       
        try {
            launcher.launchRemoteSession(startURL);
            queueSet.waitForLoad(configuration.getTimeoutInSeconds() * 1000l);

            // TODO DGF log4j only
            // NDC.push("sessionId="+sessionId);
            FrameGroupCommandQueueSet queue = getQueueSet(sessionId);
View Full Code Here

          if (values.size() < 1) {
                results = "ERROR: You must specify a browser";
            } else {
                String browser = values.get(0);
                String newSessionId = generateNewSessionId();
                BrowserLauncher simpleLauncher = browserLauncherFactory.getBrowserLauncher(browser, newSessionId, remoteControl.getConfiguration(), new BrowserConfigurationOptions());
                String baseUrl = "http://localhost:" + remoteControl.getPort();
                remoteControl.registerBrowserSession(new BrowserSessionInfo(
                    newSessionId, browser, baseUrl, simpleLauncher, null));
                simpleLauncher.launchHTMLSuite("TestPrompt.html?thisIsSeleniumServer=true", baseUrl);
                results = "OK";
            }
          break;
        case slowResources:
          String arg = values.get(0);
View Full Code Here

       
        configuration.copySettingsIntoBrowserOptions(browserOptions);
       
        browserOptions.setSingleWindow(!multiWindow);
       
        BrowserLauncher launcher = getBrowserLauncher(browser, sessionId, configuration, browserOptions);
        BrowserSessionInfo sessionInfo = new BrowserSessionInfo(sessionId,
            browser, browserURL, launcher, null);
       
        remoteControl.registerBrowserSession(sessionInfo);
       
        // JB: -- aren't these URLs in the wrong order according to declaration?
        launcher.launchHTMLSuite(suiteURL, browserURL);
       
        sleepTight(timeoutInMs);
       
        launcher.close();
       
        remoteControl.deregisterBrowserSession(sessionInfo);
       
        if (results == null) {
            throw new SeleniumCommandTimedOutException();
View Full Code Here

TOP

Related Classes of org.openqa.selenium.server.browserlaunchers.BrowserLauncher

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.