Example usage for org.openqa.selenium.server.htmlrunner HTMLLauncher runHTMLSuite

List of usage examples for org.openqa.selenium.server.htmlrunner HTMLLauncher runHTMLSuite

Introduction

In this page you can find the example usage for org.openqa.selenium.server.htmlrunner HTMLLauncher runHTMLSuite.

Prototype

public String runHTMLSuite(String browser, String startURL, String suiteURL, File outputFile,
        long timeoutInSeconds, String userExtensions) throws IOException 

Source Link

Document

Launches a single HTML Selenium test suite.

Usage

From source file:com.tascape.qa.th.webui.test.SeleniumIdeTests.java

License:Apache License

protected boolean runSeleniumIdeFirefox(File html, String browserURL) throws Exception {
    File tempDir = new File(html.getParentFile() + "/temp/");
    tempDir.mkdir();/*from www . j  a  v a2  s.co m*/
    File suite = File.createTempFile("selenium-ide-temp-suite-", ".html", tempDir);
    suite.deleteOnExit();
    String content = TEST_SUITE_TEMPLATE.replaceAll("XXXXXXXXXXXXXXXXXXXX", html.getName());
    FileUtils.write(suite, content);
    LOG.debug("Temp test suite file {}", suite.getAbsolutePath());

    File result = this.saveIntoFile("ide-result", "html", "");
    this.captureScreens(2000);
    HTMLLauncher launcher = new HTMLLauncher(this.seleniumServer);
    String ff = "*firefox";
    String bin = sysConfig.getProperty(Firefox.SYSPROP_FF_BINARY);
    if (bin != null) {
        ff += " " + bin;
    }
    String pf = launcher.runHTMLSuite(ff, browserURL, suite.toURI().toURL().toString(), result, 36000, true);
    suite.delete();
    return "PASSED".equals(pf);
}

From source file:com.xebia.incubator.xebium.SeleneseScriptFixture.java

License:Apache License

public String runSuite(String scriptName) throws Exception {
    if (remoteControl == null) {
        throw new IllegalStateException("Remote control should have been started before tests are executed");
    }//from  www  .j  a v a 2s.c  om

    File suiteFile = asFile(scriptName);

    String result = null;
    try {
        LOG.info("Server started, launching test suite");
        HTMLLauncher launcher = new HTMLLauncher(remoteControl);
        result = launcher.runHTMLSuite(browser, browserURL, suiteFile, outputFile, timeoutInSeconds,
                multiWindow);
        LOG.info("Finished execution of test suite, result = " + result);
    } catch (Exception e) {
        LOG.error("Failed to run test suite", e);
        throw e;
    }

    LOG.debug("End of RunScript");
    return result;
}

From source file:org.opencastproject.remotetest.ui.NonExitingSeleniumServer.java

License:Educational Community License

/**
 * {@inheritDoc}/*from  ww w .  j a v  a 2  s  .c  o  m*/
 * 
 * @see org.openqa.selenium.server.SeleniumServer#runHtmlSuite()
 */
@Override
protected void runHtmlSuite() {
    final String result;
    try {
        if (!in.exists()) {
            RemoteControlLauncher.usage("Can't find HTML Suite file:" + in.getAbsolutePath());
        }
        addNewStaticContent(in.getParentFile());
        String startURL = Main.BASE_URL;
        HTMLLauncher launcher = new HTMLLauncher(this);
        out.createNewFile();

        if (!out.canWrite()) {
            RemoteControlLauncher.usage("can't write to result file " + out.getAbsolutePath());
        }

        result = launcher.runHTMLSuite(browser, startURL, in, out, 100, false);

        if (!"PASSED".equals(result)) {
            System.err.println("Tests failed, see result file for details: " + out.getAbsolutePath());
        }
    } catch (Exception e) {
        System.err.println("HTML suite exception seen:");
        e.printStackTrace();
    }
}