Example usage for org.openqa.selenium.chrome ChromeDriver findElementByXPath

List of usage examples for org.openqa.selenium.chrome ChromeDriver findElementByXPath

Introduction

In this page you can find the example usage for org.openqa.selenium.chrome ChromeDriver findElementByXPath.

Prototype

@Override
    public WebElement findElementByXPath(String using) 

Source Link

Usage

From source file:com.joseja.glassdoorscraper.GlassdoorScraper.java

private static int getNumberOfPages(ChromeDriver driver) throws NumberFormatException {
    final int NUM_COMPANIES = Integer
            .parseInt(driver.findElementByXPath("//*[@id=\"MainCol\"]/div[1]/header/div[1]/strong[3]").getText()
                    .replace(",", ""));
    final int COMPANIES_PER_PAGE = 10;
    int NUM_PAGES = calculateNumberOfPages(NUM_COMPANIES, COMPANIES_PER_PAGE);
    return NUM_PAGES;
}