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);