Package org.openqa.selenium.htmlunit

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


      }
    }
   
    public static void testGoogleSearch(){
      //Create a new instance of GoogleSearch page
      GoogleSearchPage googleSearchPage = new GoogleSearchPage(new HtmlUnitDriver());

        // go to Google ("http://www.google.com")
      googleSearchPage.open();

        // Enter something to search for
View Full Code Here


    System.out.println("Initializing Selenium.");

    if (Config.inst().BROWSER.equals("htmlunit")) {
      System.out.println("Using HTMLUnit.");

      setDriver(new HtmlUnitDriver());
      selenium = new WebDriverBackedSelenium(getDriver(), Config.inst().TEAMMATES_URL);

    } else if (Config.inst().BROWSER.equals("firefox")) {
      System.out.println("Using Firefox.");
      setDriver(new FirefoxDriver());
View Full Code Here

    if (Config.inst().BROWSER.equals("htmlunit")) {

      System.out.println("Using HTMLUnit.");

      driver = new HtmlUnitDriver();

      selenium = new WebDriverBackedSelenium(driver, Config.inst().TEAMMATES_URL);

    } else if (Config.inst().BROWSER.equals("firefox")) {
View Full Code Here

   
    if (Config.BROWSER.equals("htmlunit")) {

      System.out.println("Using HTMLUnit.");

      driver = new HtmlUnitDriver();

      selenium = new WebDriverBackedSelenium(driver, Config.TEAMMATES_URL);

    } else if (Config.BROWSER.equals("firefox")) {
View Full Code Here

        this.serverUrl = System.getProperty("serverUrl", "http://localhost:9898/");
        if(!this.serverUrl.endsWith("/")) {
            this.serverUrl += "/";
        }

        this.driver = new HtmlUnitDriver(true)// HtmlUnitDriver with JavaScript enabled
    }
View Full Code Here

     *
     * @see org.jboss.arquillian.drone.spi.Instantiator#createInstance(org.jboss.arquillian.drone.spi.DroneConfiguration)
     */
    @Override
    public HtmlUnitDriver createInstance(TypedWebDriverConfiguration<HtmlUnitDriverConfiguration> configuration) {
        HtmlUnitDriver driver = super.createInstance(configuration);
        HtmlUnitDriver proxy = GrapheneContext.getProxyForDriver(HtmlUnitDriver.class);
        GrapheneContext.set(driver);
        return proxy;
    }
View Full Code Here

    } else if (htmlUnit()) {
      DesiredCapabilities desiredCapabilities = DesiredCapabilities.htmlUnit();
      desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDSELECTIONERROR, true);
      desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDXPATHERROR, false);
      desiredCapabilities.setJavascriptEnabled(true);
      return new HtmlUnitDriver(desiredCapabilities);
    } else if (FIREFOX.equalsIgnoreCase(browser)) {
      return maximize(new FirefoxDriver());
    } else if (OPERA.equalsIgnoreCase(browser)) {
      return createInstanceOf("com.opera.core.systems.OperaDriver");
    } else if (PHANTOMJS.equals(browser)) {
View Full Code Here

        return new WebDriverBackedSelenium(new Supplier<WebDriver>() {
            public WebDriver get() {
                if (HtmlUnitDriver.class.isAssignableFrom(webDriverClass)) {
                    final DesiredCapabilities capabilities = DesiredCapabilities.htmlUnit();
                    capabilities.setJavascriptEnabled(true);
                    return new HtmlUnitDriver(capabilities);
                } else {
                    try {
                        return webDriverClass.newInstance();
                    } catch (Exception e) {
                        return null;
View Full Code Here

    } else if (htmlUnit()) {
      DesiredCapabilities desiredCapabilities = DesiredCapabilities.htmlUnit();
      desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDSELECTIONERROR, true);
      desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDXPATHERROR, false);
      desiredCapabilities.setJavascriptEnabled(true);
      return new HtmlUnitDriver(desiredCapabilities);
    } else if (FIREFOX.equalsIgnoreCase(browser)) {
      return new FirefoxDriver();
    } else if (OPERA.equalsIgnoreCase(browser)) {
      return createInstanceOf("com.opera.core.systems.OperaDriver");
    } else {
View Full Code Here

    }

    @Override
    protected WebDriver createDriver() {
        if (webDriver == null) {
            webDriver = new HtmlUnitDriver() {
                @Override
                protected WebClient modifyWebClient(WebClient webClient) {
                    WebClient answer = super.modifyWebClient(webClient);
                    answer.addRequestHeader("Accept", "text/html");
                    answer.getCookieManager().setCookiesEnabled(true);
View Full Code Here

TOP

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

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.