Examples of PhantomJSDriver


Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

  private EmbeddedBrowser newPhantomJSDriver(ImmutableSortedSet<String> filterAttributes,
          long crawlWaitReload, long crawlWaitEvent) {

    DesiredCapabilities caps = new DesiredCapabilities();
    caps.setCapability("takesScreenshot", true);
    PhantomJSDriver phantomJsDriver = new PhantomJSDriver(caps);

    return WebDriverBackedEmbeddedBrowser.withDriver(phantomJsDriver, filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

    } else if (OPERA.equalsIgnoreCase(browser)) {
      return createInstanceOf("com.opera.core.systems.OperaDriver");
    } else if (PHANTOMJS.equals(browser)) {
      DesiredCapabilities capabilities = new DesiredCapabilities();
      capabilities.setJavascriptEnabled(true);
      return new PhantomJSDriver(capabilities);
    } else {
      return createInstanceOf(browser);
    }
  }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

      final String proxyTypeCap = "--proxy-type=http";
      final String[] args = new String[] { proxyAddrCap, proxyTypeCap };
      caps.setCapability(PhantomJSDriverService.PHANTOMJS_CLI_ARGS, args);
    }
   
    PhantomJSDriver phantomJsDriver = new PhantomJSDriver(caps);

    return WebDriverBackedEmbeddedBrowser.withDriver(phantomJsDriver, filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

    public WebDriver newHtmlUnitDriver(Capabilities capabilities) {
        return new HtmlUnitDriver(capabilities);
    }

    public WebDriver newPhantomDriver(Capabilities caps) {
        return new PhantomJSDriver(caps);
    }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

        outputDirectory = newTemporaryDirectory();
        reporter.setOutputDirectory(outputDirectory);

        File sourceDirectory = directoryInClasspathCalled("/test-outcomes/containing-nostep-errors");
        reporter.generateReportsForTestResultsFrom(sourceDirectory);
        driver = new PhantomJSDriver();
    }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

    private static WebDriver driver;

    @BeforeClass
    public static void openStaticTestSite() {
        String url = "file://" + fileInClasspathCalled("static-site/index.html").getAbsolutePath();
        driver = new PhantomJSDriver();
        driver.get(url);
    }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

    private static StaticSitePage page;
    private static WebDriver driver;

    @BeforeClass
    public static void openDriver() {
        driver = new PhantomJSDriver();
        page = new StaticSitePage(driver, 1000);
        page.open();
    }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

        driver.quit();
    }

    @Test
    public void should_inject_jquery_into_the_page() {
        WebDriver driver = new PhantomJSDriver();
        StaticSitePage page = new StaticSitePage(driver, 1000);
        getPage().open();

        getPage().evaluateJavascript("$('#firstname').focus();");

        Boolean jqueryInjected = (Boolean) getPage().evaluateJavascript("return (typeof jQuery === 'function')");
        assertThat(jqueryInjected, is(true));

        driver.quit();
    }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

    public StaticSitePage getPage() {
        try {
            page.getTitle();
        } catch (UnreachableBrowserException e) {
            driver = new PhantomJSDriver();
            page = new StaticSitePage(driver, 1000);           
        }
        return page;
    }
View Full Code Here

Examples of org.openqa.selenium.phantomjs.PhantomJSDriver

    private static WebDriver phantomDriver;
    private static StaticSitePage phantomPage;

    @BeforeClass
    public static void openBrowsers() {
        phantomDriver = new PhantomJSDriver();
        phantomPage = new StaticSitePage(phantomDriver, 1000);
    }
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.