Package org.openqa.selenium.firefox

Examples of org.openqa.selenium.firefox.FirefoxDriver


    private WebDriver driver;

    @BeforeClass
    public void beforeClass() {
        driver = new FirefoxDriver();
    }
View Full Code Here


      secondsBetweenRuns = Integer.parseInt(args[2]);
    }

    for (int c = 0; c < count; c++) {
      System.out.println("SESSION " + (c+1) + " STARTING!");
      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++) {
        // browse all pages
        List<WebElement> nextPageLinks = driver.findElements(By.className("next_page"));
        if (!nextPageLinks.isEmpty()) {
          WebElement nextPageLink = nextPageLinks.get(0);
          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);
          }
        }

        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

    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("network.proxy.type", 1);
    profile.setPreference("network.proxy.socks", "127.0.0.1");
    profile.setPreference("network.proxy.socks_port", 9150);
    FirefoxDriver firefoxDriver = new FirefoxDriver(profile);
    firefoxDriver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
    return firefoxDriver;
  }
View Full Code Here

      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 {
      return createInstanceOf(browser);
    }
View Full Code Here

    }

    protected WebDriver createFireFoxWebDriver() throws Exception {
        File profile = new File(profileDir, "firefox");
        profile.mkdirs();
        return new FirefoxDriver(new FirefoxProfile(profile));
    }
View Full Code Here

  @Before
  public void setUp() throws Exception {
    super.setUp();
    FirefoxProfile profile = new FirefoxProfile();
    profile.setPreference("intl.accept_languages", getLocale());
    driver = new FirefoxDriver(profile);
  }
View Full Code Here

    ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
    URL driverURL = null;
    switch (target) {
    case FIREFOX:
     
      return new FirefoxDriver();
    case IE:
      driverURL = contextClassLoader.getResource("archive/IEDriverServer.exe");
      if (driverURL == null) {
        throw new NullPointerException("Cannot find IEDriverServer instance, copy IEDriverServer.exe from driver to /src/archive/");
      }
View Full Code Here

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

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

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

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

      profile.setPreference("network.proxy.type", configuration.getProxyConfiguration()
              .getType().toInt());
      /* use proxy for everything, including localhost */
      profile.setPreference("network.proxy.no_proxies_on", "");

      return WebDriverBackedEmbeddedBrowser.withDriver(new FirefoxDriver(profile),
              filterAttributes, crawlWaitReload, crawlWaitEvent);
    }

    return WebDriverBackedEmbeddedBrowser.withDriver(new FirefoxDriver(), filterAttributes,
            crawlWaitEvent, crawlWaitReload);
  }
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.