
Untitled
By: a guest on
May 11th, 2012 | syntax:
None | size: 1.08 KB | hits: 42 | expires: Never
WebDriver driver = new FirefoxDriver();
driver.manage().timeouts().implicitlyWait(15, TimeUnit.SECONDS);
driver.get("http://buckeyelink.osu.edu/");
driver.findElement(By.cssSelector("fieldset.catalog div.first a[title=\"Schedule of Classes\"]")).click();
driver.switchTo().frame(driver.findElement(By.id("ptifrmtgtframe")));
WebElement select = driver.findElement(By.id("CLASS_SRCH_WRK2_STRM$48$"));
(new Select(select)).selectByValue("1118");
(new WebDriverWait(driver, 10)).until(new ExpectedCondition<Boolean>() {
@Override
public Boolean apply(WebDriver d) {
return d.findElement(By.id("WAIT_win0")).getCssValue("display").equalsIgnoreCase("none");
}
});
driver.findElement(By.id("CLASS_SRCH_WRK2_SSR_PB_SRCH$56$")).click();
(new Select(driver.findElement(By.id("OSR_CAT_SRCH_WK_DESCR")))).selectByVisibleText("Computer Science & Engineering");
driver.findElement(By.id("CLASS_SRCH_WRK2_SSR_PB_CLASS_SRCH")).click();
driver.findElement(By.id("DERIVED_CLSRCH_SSR_CLASSNAME_LONG$0")).click();
assert(driver.findElement(By.id("SSR_CLS_DTL_WRK_CLASS_NBR")).getText().equals("4743"));
driver.quit();