Package com.thoughtworks.selenium

Examples of com.thoughtworks.selenium.DefaultSelenium


        super(test);
    }

    protected void setUp() throws Exception
    {
        this.selenium = new DefaultSelenium("localhost", SELENIUM_PORT, BROWSER, BASE_URL) {
            /**
             * Selenium RC Java Client Driver has introduced a non-backward compatible change: open() nows checks
             * for error code and throw an error if a non 200 is found. Since our XWiki pages return non 200 codes
             * in some cases our tests now fail. See http://jira.openqa.org/browse/SEL-684
             * What's strange is that the source code shows that a new open(String, String ignoreErrorCode) has been
View Full Code Here


        logger.info("setup: serverPort=" + serverPort);
        logger.info("setup: browser=" + browser);
        logger.info("setup: startUrl=" + startUrl);
        logger.info("setup: timeout=" + timeout);
        logger.info("setup: imagePath=" + imagePath);
        this.sel = new DefaultSelenium(serverHost, Integer.parseInt(serverPort), browser, startUrl);
        this.sel.start();
        this.sel.setTimeout(timeout);
    }
View Full Code Here

        maxWaitTimeInMs = p.getProperty( "MAX_WAIT_TIME_IN_MS" );

        String seleniumHost = p.getProperty( "SELENIUM_HOST" );
        int seleniumPort = Integer.parseInt( ( p.getProperty( "SELENIUM_PORT" ) ) );
        String seleniumBrowser = p.getProperty( "SELENIUM_BROWSER" );
        final Selenium s = new DefaultSelenium( seleniumHost, seleniumPort, seleniumBrowser, baseUrl );
        selenium = new ThreadLocal<Selenium>() {
            protected Selenium initialValue() {
                return s;
            }
        };
View Full Code Here

        if ( StringUtils.isEmpty( browser ) )
        {
            browser = p.getProperty( "SELENIUM_BROWSER" );
        }

        sel = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl );
        sel.start();
        initialize();
    }
View Full Code Here

     * (non-Javadoc)
     *
     * @see org.jboss.arquillian.drone.spi.Instantiator#createInstance(org.jboss. arquillian.drone.spi.DroneConfiguration)
     */
    public DefaultSelenium createInstance(SeleniumConfiguration configuration) {
        DefaultSelenium selenium = new DefaultSelenium(configuration.getServerHost(), configuration.getServerPort(),
                configuration.getBrowser(), configuration.getUrl());
        selenium.start();
        selenium.setSpeed(String.valueOf(configuration.getSpeed()));
        selenium.setTimeout(String.valueOf(configuration.getTimeout()));

        return selenium;
    }
View Full Code Here

        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()
        {
            public void run()
            {
                try
                {
                    selenium.stop();
                    seleniumServer.stop();
                    stopWebServer.run();

                    // Output, at the end of the Test, any html capture or screen shots (this makes it much easier
                    // to locate them at the end of the run; there's such a variance on where they end up based
View Full Code Here

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

        ErrorReporter errorReporter = new ErrorReporterImpl(cp, testContext);

        selenium = new DefaultSelenium(new ErrorReportingCommandProcessor(cp, errorReporter));

        selenium.start();
    }
View Full Code Here

        seleniumServer.start();

        String browserStartCommand = xmlTest.getParameter(TapestryTestConstants.BROWSER_START_COMMAND_PARAMETER);
        browserStartCommand = browserStartCommand != null ? browserStartCommand : FIREFOX_BROWSER_CMD;

        selenium = new DefaultSelenium(
                "localhost", RemoteControlConfiguration.DEFAULT_PORT,
                browserStartCommand, "http://localhost:9091/"
        );
        selenium.start();
    }
View Full Code Here

        this.browser = browser;

        if ( getSelenium() == null )
        {
            DefaultSelenium s = new DefaultSelenium( seleniumHost, seleniumPort, browser, baseUrl );
            s.start();
            s.setTimeout( maxWaitTimeInMs );
            selenium.set( s );
        }
    }
View Full Code Here

       
        int seleniumPort = Integer.parseInt( System.getProperty( "selenium.port", "4444" ) );
        String browser = System.getProperty( "seleniumBrowser", "*firefox" );
        String serverUrl = System.getProperty( "serverUrl", "http://localhost:9090/" );
       
        DefaultSelenium s = new DefaultSelenium( "localhost", seleniumPort, browser, serverUrl );
        s.start(  );
        s.open( "index.html" );
        s.type( "who", "foo" );
        s.click( "send-btn" );
        // wait a bit ajax response
        Thread.sleep( 1000 );
        String text = s.getText( "response" );
        assertEquals( "Hello foo", text );

    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.selenium.DefaultSelenium

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.