Examples of BrowserSessionInfo


Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

    public void testGrabAvailableSession() {
        BrowserSessionFactory factory = getTestSessionFactory();
        factory.addToAvailableSessions(getTestSession1());
        assertTrue(factory.hasAvailableSession(SESSION_ID_1));
        assertFalse(factory.hasActiveSession(SESSION_ID_1));
        BrowserSessionInfo result = factory.grabAvailableSession(BROWSER_1, BASEURL1);
        assertEquals(SESSION_ID_1, result.sessionId);
        assertFalse(factory.hasAvailableSession(SESSION_ID_1));
        assertTrue(factory.hasActiveSession(SESSION_ID_1));
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

        RemoteControlConfiguration configuration = new RemoteControlConfiguration();
        configuration.setReuseBrowserSessions(true);
        factory.endBrowserSession(SESSION_ID_1, configuration);
        assertFalse(factory.hasActiveSession(SESSION_ID_1));
        assertTrue(factory.hasAvailableSession(SESSION_ID_1));
        BrowserSessionInfo info = factory.lookupInfoBySessionId(SESSION_ID_1,
                factory.availableSessions);
        assertTrue(info.lastClosedAt >= closingTime);
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

        assertFalse(factory.hasAvailableSession(SESSION_ID_1));
    }

    public void disable_testRemoveIdleAvailableSessionsViaCleanup() {
        BrowserSessionFactory factory = new BrowserSessionFactory(null, 5, 0, true);
        BrowserSessionInfo info1 = getTestSession1();
        info1.lastClosedAt = 0; // very idle.
        factory.addToAvailableSessions(info1);
        FrameGroupCommandQueueSet.sleepForAtLeast(5);
        assertFalse(factory.hasAvailableSession(SESSION_ID_1));
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

        assertFalse(factory.hasAvailableSession(SESSION_ID_1));
    }

    private Set<BrowserSessionInfo> getTestSessionSet() {
        Set<BrowserSessionInfo> infos = new HashSet<BrowserSessionInfo>();
        BrowserSessionInfo info1 = getTestSession1();
        infos.add(info1);
        BrowserSessionInfo info2 = getTestSession2();
        infos.add(info2);
        return infos;
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

        return infos;
    }

    private BrowserSessionInfo getTestSession1() {
        DummyLauncher mockLauncher1 = new DummyLauncher();
        return new BrowserSessionInfo(
                SESSION_ID_1, BROWSER_1, BASEURL1, mockLauncher1, null);
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

                SESSION_ID_1, BROWSER_1, BASEURL1, mockLauncher1, null);
    }

    private BrowserSessionInfo getTestSession2() {
        DummyLauncher mockLauncher2 = new DummyLauncher();
        return new BrowserSessionInfo(
                SESSION_ID_2, BROWSER2, BASEURL2, mockLauncher2, null);
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

            } 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;
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

    }

    protected String getNewBrowserSession(String browserString, String startURL, String extensionJs,
            BrowserConfigurationOptions browserConfigurations)
        throws RemoteCommandException {
        BrowserSessionInfo sessionInfo =  browserSessionFactory
            .getNewBrowserSession(browserString, startURL, extensionJs,
                    browserConfigurations, remoteControl.getConfiguration());
        setLastSessionId(sessionInfo.sessionId);
        return sessionInfo.sessionId;
    }
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

            } else {
              String browser = values.get(0);
                String newSessionId = generateNewSessionId();
                BrowserLauncher simpleLauncher = browserLauncherFactory.getBrowserLauncher(browser, newSessionId);
                String baseUrl = "http://localhost:" + server.getPort();
                server.registerBrowserSession(new BrowserSessionInfo(
                    newSessionId, browser, baseUrl, simpleLauncher, null));
                simpleLauncher.launchHTMLSuite("TestPrompt.html?thisIsSeleniumServer=true", baseUrl, false, "info");
                results = "OK";
            }
        } else if ("slowResources".equals(cmd)) {
View Full Code Here

Examples of org.openqa.selenium.server.BrowserSessionFactory.BrowserSessionInfo

        return UUID.randomUUID().toString().replaceAll("-", "");
    }

    protected String getNewBrowserSession(String browserString, String startURL)
          throws RemoteCommandException {
        BrowserSessionInfo sessionInfo =
            browserSessionFactory.getNewBrowserSession(
            browserString, startURL, server.isMultiWindow());
        setLastSessionId(sessionInfo.sessionId);
        return sessionInfo.sessionId;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.