Package org.openqa.selenium.server

Examples of org.openqa.selenium.server.SeleniumServer$ShutDownHook


    @BeforeClass
    public void setup() throws Exception
    {
        _jettyRunner = new JettyRunner("/", JETTY_PORT, "src/test/app1");

        _server = new SeleniumServer();

        _server.start();

        _selenium = new DefaultSelenium("localhost", SeleniumServer.DEFAULT_PORT, "*firefox",
                BASE_URL);
View Full Code Here


    @BeforeClass(alwaysRun = true)
    public void setup() throws Exception
    {
        jettyRunner = new JettyRunner(TapestryTestConstants.MODULE_BASE_DIR, "/", JETTY_PORT, webappRoot);

        server = new SeleniumServer();

        server.start();

        CommandProcessor cp = new HttpCommandProcessor("localhost", RemoteControlConfiguration.DEFAULT_PORT,
                                                       seleniumBrowserCommand, BASE_URL);
View Full Code Here

    public void setup(ITestContext testContext) throws Exception
    {
        jettyRunner = new JettyRunner(TapestryTestConstants.MODULE_BASE_DIR, "/", JETTY_PORT,
                webappRoot, virtualHosts);

        server = new SeleniumServer();

        server.start();

        CommandProcessor cp = new HttpCommandProcessor("localhost",
                RemoteControlConfiguration.DEFAULT_PORT, seleniumBrowserCommand, BASE_URL);
View Full Code Here

        String browserStartCommand = getParameter(xmlTest, TapestryTestConstants.BROWSER_START_COMMAND_PARAMETER,
                "*firefox");

        final Runnable stopWebServer = launchWebServer(webAppFolder, contextPath, port, sslPort);

        final SeleniumServer seleniumServer = new SeleniumServer();

        File ffProfileTemplate = new File(TapestryTestConstants.MODULE_BASE_DIR, "src/test/conf/ff_profile_template");

        if (ffProfileTemplate.isDirectory())
            seleniumServer.getConfiguration().setFirefoxProfileTemplate(ffProfileTemplate);

        seleniumServer.start();

        String baseURL = String.format("http://localhost:%d%s/", port, contextPath);

        CommandProcessor httpCommandProcessor = new HttpCommandProcessor("localhost", RemoteControlConfiguration.DEFAULT_PORT,
                browserStartCommand, baseURL);

        ErrorReporter errorReporter = new ErrorReporterImpl(httpCommandProcessor, testContext);

        ErrorReportingCommandProcessor commandProcessor = new ErrorReportingCommandProcessor(httpCommandProcessor, errorReporter);

        final Selenium selenium = new DefaultSelenium(commandProcessor);

        selenium.start();

        testContext.setAttribute(TapestryTestConstants.BASE_URL_ATTRIBUTE, baseURL);
        testContext.setAttribute(TapestryTestConstants.SELENIUM_ATTRIBUTE, selenium);
        testContext.setAttribute(TapestryTestConstants.ERROR_REPORTER_ATTRIBUTE, errorReporter);
        testContext.setAttribute(TapestryTestConstants.COMMAND_PROCESSOR_ATTRIBUTE, commandProcessor);

        testContext.setAttribute(TapestryTestConstants.SHUTDOWN_ATTRIBUTE, new Runnable()
        {
            public void run()
            {
                try
                {
                    selenium.stop();
                    seleniumServer.stop();
                    stopWebServer.run();
                }
                finally
                {

View Full Code Here

    @BeforeClass(alwaysRun = true)
    public void setup() throws Exception
    {
        jettyRunner = new JettyRunner(TapestryTestConstants.MODULE_BASE_DIR, "/", JETTY_PORT, webappRoot);

        server = new SeleniumServer();

        server.start();

        CommandProcessor cp = new HttpCommandProcessor("localhost", RemoteControlConfiguration.DEFAULT_PORT,
                                                       seleniumBrowserCommand, BASE_URL);
View Full Code Here

    @BeforeClass(alwaysRun = true)
    public void setup() throws Exception
    {
        jettyRunner = new JettyRunner(TapestryTestConstants.MODULE_BASE_DIR, "/", JETTY_PORT, webappRoot, virtualHosts);

        server = new SeleniumServer();

        server.start();

        CommandProcessor cp = new HttpCommandProcessor("localhost", RemoteControlConfiguration.DEFAULT_PORT,
                                                       seleniumBrowserCommand, BASE_URL);
View Full Code Here

                "  browserStart: " + browserStartCommand + sep +
                "       baseURL: " + baseURL);

        final Runnable stopWebServer = launchWebServer(container, webAppFolder, contextPath, port, sslPort);

        final SeleniumServer seleniumServer = new SeleniumServer();

        File ffProfileTemplate = new File(TapestryRunnerConstants.MODULE_BASE_DIR, "src/test/conf/ff_profile_template");

        if (ffProfileTemplate.isDirectory())
        {
            seleniumServer.getConfiguration().setFirefoxProfileTemplate(ffProfileTemplate);
        }

        seleniumServer.start();


        CommandProcessor httpCommandProcessor = new HttpCommandProcessor("localhost",
                seleniumServer.getPort(), browserStartCommand, baseURL);

        final ErrorReporterImpl errorReporter = new ErrorReporterImpl(httpCommandProcessor, testContext);

        ErrorReportingCommandProcessor commandProcessor = new ErrorReportingCommandProcessor(httpCommandProcessor,
                errorReporter);

        final Selenium selenium = new DefaultSelenium(commandProcessor);

        selenium.start();

        testContext.setAttribute(TapestryTestConstants.BASE_URL_ATTRIBUTE, baseURL);
        testContext.setAttribute(TapestryTestConstants.SELENIUM_ATTRIBUTE, selenium);
        testContext.setAttribute(TapestryTestConstants.ERROR_REPORTER_ATTRIBUTE, errorReporter);
        testContext.setAttribute(TapestryTestConstants.COMMAND_PROCESSOR_ATTRIBUTE, commandProcessor);

        testContext.setAttribute(TapestryTestConstants.SHUTDOWN_ATTRIBUTE, new Runnable()
        {
            @Override
            public void run()
            {
                try
                {
                    LOGGER.info("Shutting down selenium client ...");

                    try
                    {
                        selenium.stop();
                    } catch (RuntimeException e)
                    {
                        LOGGER.error("Selenium client shutdown failure.", e);
                    }

                    LOGGER.info("Shutting down selenium server ...");

                    try
                    {
                        seleniumServer.stop();
                    } catch (RuntimeException e)
                    {
                        LOGGER.error("Selenium server shutdown failure.", e);
                    }
View Full Code Here

        if (configuration == null || configuration.isSkip()) {
            return;
        }

        try {
            SeleniumServer server = new SeleniumServer(configure(configuration));
            SystemEnvHolder sysEnv = new SystemEnvHolder();
            sysEnv.modifyEnvBy(configuration);
            server.start();
            sysEnv.restore();

            seleniumServer.set(server);
            afterStart.fire(new SeleniumServerStarted());
        } catch (Exception e) {
View Full Code Here

    @BeforeClass(alwaysRun = true)
    public void setup() throws Exception
    {
        _jettyRunner = new JettyRunner(TapestryTestConstants.MODULE_BASE_DIR, "/", JETTY_PORT, _webappRoot);

        _server = new SeleniumServer();

        _server.start();

        CommandProcessor cp = new HttpCommandProcessor("localhost", SeleniumServer.DEFAULT_PORT, "*firefox", BASE_URL);

View Full Code Here

        if(testParameters.containsKey(TapestryTestConstants.BROWSER_START_COMMAND_PARAMETER))
            browserStartCommand = testParameters.get(TapestryTestConstants.BROWSER_START_COMMAND_PARAMETER);
       
        stopWebServer = launchWebServer(webAppFolder, contextPath, port, sslPort);

        seleniumServer = new SeleniumServer();
       
        File ffProfileTemplate = new File(TapestryTestConstants.MODULE_BASE_DIR, "src/test/conf/ff_profile_template");
       
        if(ffProfileTemplate.isDirectory())
            seleniumServer.getConfiguration().setFirefoxProfileTemplate(ffProfileTemplate);
View Full Code Here

TOP

Related Classes of org.openqa.selenium.server.SeleniumServer$ShutDownHook

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.