Package org.openqa.selenium.firefox

Examples of org.openqa.selenium.firefox.FirefoxDriver.findElement()


         
          // 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) {
View Full Code Here


          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) {
              WebElement resultsDiv = driver.findElement(By.className("gsq_a"));

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

      FirefoxDriver driver = initDriver();
      System.out.println("IP ADDRESS: " + getCurrentIp(driver));
      System.out.println("Opening TR Page...");
      driver.get(TR_MAIN_PAGE);

      driver.findElement(By.className("selectBox-label")).click();
      WebElement dropdownMenu = driver.findElement(By.className("selectBox-dropdown-menu"));
      List<WebElement> sectionLis = dropdownMenu.findElements(By.tagName("li"));
      System.out.println("Section count: " + sectionLis.size());

      for (int i = 0; i < sectionLis.size(); i++) {
View Full Code Here

      System.out.println("IP ADDRESS: " + getCurrentIp(driver));
      System.out.println("Opening TR Page...");
      driver.get(TR_MAIN_PAGE);

      driver.findElement(By.className("selectBox-label")).click();
      WebElement dropdownMenu = driver.findElement(By.className("selectBox-dropdown-menu"));
      List<WebElement> sectionLis = dropdownMenu.findElements(By.tagName("li"));
      System.out.println("Section count: " + sectionLis.size());

      for (int i = 0; i < sectionLis.size(); i++) {
        // browse all pages
View Full Code Here

          String visibility = nextPageLink.getCssValue("visibility");
          boolean nextPageButtonVisible = !"hidden".equals(visibility);
          while (nextPageButtonVisible) {
            nextPageLink.click();
            Thread.sleep(2000);
            nextPageLink = driver.findElement(By.className("next_page"));
            visibility = nextPageLink.getCssValue("visibility");
            nextPageButtonVisible = !"hidden".equals(visibility);
          }
        }
View Full Code Here

            nextPageButtonVisible = !"hidden".equals(visibility);
          }
        }

        if (i > 0) {
          driver.findElement(By.className("selectBox-label")).click();
          dropdownMenu = driver.findElement(By.className("selectBox-dropdown-menu"));
          sectionLis = dropdownMenu.findElements(By.tagName("li"));
        }

        sectionLis.get(i).findElement(By.tagName("a")).click();
View Full Code Here

          }
        }

        if (i > 0) {
          driver.findElement(By.className("selectBox-label")).click();
          dropdownMenu = driver.findElement(By.className("selectBox-dropdown-menu"));
          sectionLis = dropdownMenu.findElements(By.tagName("li"));
        }

        sectionLis.get(i).findElement(By.tagName("a")).click();
        Thread.sleep(5000);
View Full Code Here

        // start capture
        proxy.newHar("twitter.com");

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

        // "page 2"
        driver.findElement(By.xpath("//div[text() = 'Search']")).click();
        driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear
View Full Code Here

        // page 1
        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

        // "page 2"
        driver.findElement(By.xpath("//div[text() = 'Search']")).click();
        driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear

        // write the har file out
        new PerformanceTiming(driver, proxy.getHar());
        proxy.getHar().writeTo(new File("/tmp/twitter.com.har"));
View Full Code Here

        driver.get("http://twitter.com/#!/search-home");
        driver.findElement(By.xpath("//div[text() = 'Search']/../../input")).sendKeys("#WebPerfSD");

        // "page 2"
        driver.findElement(By.xpath("//div[text() = 'Search']")).click();
        driver.findElement(By.cssSelector(".tweet")); // wait for next page & tweets to appear

        // write the har file out
        new PerformanceTiming(driver, proxy.getHar());
        proxy.getHar().writeTo(new File("/tmp/twitter.com.har"));
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.