Package org.openqa.selenium.htmlunit

Examples of org.openqa.selenium.htmlunit.HtmlUnitDriver$JavaScriptResultsCollection


  @Before
  public void stubResourceStreams() throws IOException {
    spy(FileUtils.class);

    when(this.ioUtilsWrapper.toString(isA(String.class))).thenReturn(BUILD_REPORT_JS_CONTENTS,JUNIT_RESULTS);
    driver = new HtmlUnitDriver(BrowserVersion.FIREFOX_24);
    driver.setJavascriptEnabled(true);
  }
View Full Code Here


    if (browser.indexOf(':') > -1) {
      // Use constants BrowserType.IE, BrowserType.FIREFOX, BrowserType.CHROME etc.
      String emulatedBrowser = browser.replaceFirst("htmlunit:(.*)", "$1");
      capabilities.setVersion(emulatedBrowser);
    }
    return new HtmlUnitDriver(capabilities);
  }
View Full Code Here

  @BeforeClass
  public static void start() throws Exception {
    localWebServer = new JettyServer(webServerPort);
    downloadURI200 = new URI(webServerURL + ":" + webServerPort + "/downloadTest.html");
    downloadURI404 = new URI(webServerURL + ":" + webServerPort + "/doesNotExist.html");
    driver = new HtmlUnitDriver();
  }
View Full Code Here

                switch (this.desc) {
                    case "firefox"  : this.driver = new FirefoxDriver();break;
                    case "iexplorer": this.driver = new InternetExplorerDriver();break;
                    case "chrome"   : this.driver = new ChromeDriver();break;
                    case "opera"    : this.driver = new OperaDriver();break;
                    case "htmlunit" : this.driver = new HtmlUnitDriver();break;
                }
                setJSDriver();
                this.driver.manage().timeouts().pageLoadTimeout(MAX_WAIT_S, TimeUnit.SECONDS);
                this.driver.manage().timeouts().implicitlyWait(MAX_WAIT_S, TimeUnit.SECONDS);
            }
View Full Code Here

*/
public class AcceptanceTest {
  public static final String SUITE = "acceptance";

  public static WebDriver createWebDriver() {
    return new HtmlUnitDriver();
  }
View Full Code Here

        + "]";

    @Test
    public void registerRollup() throws Exception {
        Runner runner = new Runner();
        runner.setDriver(new HtmlUnitDriver(true));
        RollupRules rollupRules = runner.getRollupRules();
        rollupRules.load(getClass().getResourceAsStream("/rollup/user-extention-rollup.js"));
        IRollupRule rule = rollupRules.get("do_login");
        assertThat(rule, is(instanceOf(RollupRule.class)));
        Map<String, String> rollupArgs = new HashMap<String, String>();
View Full Code Here

    private static final String TEST_SUITE = "/selenese/testSuite.html";

    @Test
    public void parseTestCaseWithoutBaseURL() {
        Runner runner = new Runner();
        runner.setDriver(new HtmlUnitDriver(true));
        InputStream is = null;
        try {
            is = getClass().getResourceAsStream(WITHOUT_BASE_URL);
            Selenese selenese = Parser.parse(WITHOUT_BASE_URL, is, runner.getCommandFactory());
            assertThat(selenese, is(instanceOf(TestCase.class)));
View Full Code Here

    }

    @Test
    public void parseTestSuite() {
        Runner runner = new Runner();
        runner.setDriver(new HtmlUnitDriver(true));
        InputStream is = null;
        try {
            is = getClass().getResourceAsStream(TEST_SUITE);
            Selenese selenese = Parser.parse(TEST_SUITE, is, runner.getCommandFactory());
            assertThat(selenese, is(instanceOf(TestSuite.class)));
View Full Code Here

    @Test
    public void generateHtmlResultOld() throws Exception {
        File root = getTmpRoot();
        Runner runner = new Runner();
        CommandFactory cf = runner.getCommandFactory();
        runner.setDriver(new HtmlUnitDriver(true));
        String s1name = "suite1";
        TestSuite s1 = Binder.newTestSuite(filename(root, s1name), s1name, runner);
        String s2name = "suite2";
        TestSuite s2 = Binder.newTestSuite(filename(root, s2name), s2name, runner);
        String c1name = "case1";
View Full Code Here

    @Test
    public void emptyFile() throws IOException {
        File tmp = File.createTempFile("aaa", "test.html");
        Runner runner = new Runner();
        runner.setDriver(new HtmlUnitDriver());
        Result result = runner.run(tmp.getCanonicalPath());
        assertThat(result, is(instanceOf(Error.class)));
        assertThat(result.getMessage(), containsString("Not selenese script."));
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.htmlunit.HtmlUnitDriver$JavaScriptResultsCollection

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.