Package org.openqa.selenium.firefox

Examples of org.openqa.selenium.firefox.FirefoxDriver


  protected WebDriver createChromeDriver() {
    return new ChromeDriver();
  }

  protected WebDriver createFirefoxDriver() {
    return new FirefoxDriver();
  }
View Full Code Here


      desiredCapabilities.setCapability(HtmlUnitDriver.INVALIDXPATHERROR, false);
      desiredCapabilities.setJavascriptEnabled(true);
      return new HtmlUnitDriver(desiredCapabilities);
    }
    else {
      return new FirefoxDriver();
    }
  }
View Full Code Here

      throws MalformedURLException {
    System.out.println("-->> Entrou na criacao da instancia.");
    DesiredCapabilities caps = null;
    if (version.equalsIgnoreCase("local")) {
      System.out.println("-->> Criando nova instância do driver como local.");
      driver = new FirefoxDriver();
    }

    if (version.equalsIgnoreCase("XPGC35")) {
      System.out.println("-->> Criando nova instância do driver como XPGC35.");
      caps = DesiredCapabilities.chrome();
View Full Code Here

      caps = DesiredCapabilities.safari();
      caps.setCapability("platform", "MAC");
      caps.setCapability("version", "6");
      break;     
    case "local":
      driver = new FirefoxDriver();
      break;
    }

    if(!version.equalsIgnoreCase("local")){
      System.out.println("-->>> IP Selenium Server: " + Util.IP_SELENIUM_SERVER);
View Full Code Here

    private static WebDriver driver;

    public static WebDriver getWebDriver() {
        if (driver == null) {
            driver = new FirefoxDriver();
            driver.manage().timeouts().implicitlyWait(5, SECONDS);
        }
        return driver;
    }
View Full Code Here

        DesiredCapabilities capability = DesiredCapabilities.firefox();
        capability.setCapability(CapabilityType.PROXY, proxy);

        String urlString = "http://www.yahoo.com/";
        WebDriver driver = new FirefoxDriver(capability);
        driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);

        driver.get(urlString);

        driver.close();
        System.out.println("Driver closed");

        proxyServer.stop();
        System.out.println("Proxy stopped");
    }
View Full Code Here

        capability.setCapability(CapabilityType.PROXY, proxy);

        final String urlString = "http://www.yahoo.com/";

        // Note this will actually launch a browser!!
        final WebDriver driver = new FirefoxDriver(capability);
        driver.manage().timeouts().pageLoadTimeout(30, TimeUnit.SECONDS);

        driver.get(urlString);
        final String source = driver.getPageSource();

        // Just make sure it got something within reason.
        assertTrue(source.length() > 100);
        driver.close();

        proxyServer.stop();
    }
View Full Code Here

    LOG.debug("Starting Jetty");
    server = new Server(0);

    String url = setupJetty();
    LOG.info("Jetty started on {}", url);
    driver = new FirefoxDriver();
    LOG.debug("Starting selenium");
    selenium = new WebDriverBackedSelenium(driver, url);

    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }
View Full Code Here

  @ClassRule
  public static final CrawljaxServerResource SERVER = new CrawljaxServerResource();

  @BeforeClass
  public static void setup() throws Exception {
    driver = new FirefoxDriver();
    LOG.debug("Starting selenium");
    selenium = new WebDriverBackedSelenium(driver, SERVER.getUrl());
    driver.manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);
  }
View Full Code Here


    @Test
    public void shouldUseFireFoxToGoToGoogleSuggests(){
       // The Firefox driver supports javascript
        WebDriver driver = new FirefoxDriver();

        // Go to the Google Suggest home page
        driver.get("http://www.google.com/webhp?complete=1&hl=en");

        // Enter the query string "Cheese"
        WebElement query = driver.findElement(By.name("q"));
        query.sendKeys("Cheese");

        // Sleep until the div we want is visible or 5 seconds is over
        long end = System.currentTimeMillis() + 5000;
        while (System.currentTimeMillis() < end) {
            // Browsers which render content (such as Firefox and IE)
            // return "RenderedWebElements"
            RenderedWebElement resultsDiv = (RenderedWebElement) driver.findElement(By.className("gac_m"));

            // If results have been returned,
            // the results are displayed in a drop down.
            if (resultsDiv.isDisplayed()) {
              break;
            }
        }

        // And now list the suggestions
        List<WebElement> allSuggestions = driver.findElements(By.xpath("//td[@class='gac_c']"));

        for (WebElement suggestion : allSuggestions) {
            System.out.println(suggestion.getText());
        }
    }
View Full Code Here

TOP

Related Classes of org.openqa.selenium.firefox.FirefoxDriver

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.