List of usage examples for org.openqa.selenium.firefox FirefoxDriver findElementById
@Override
public WebElement findElementById(String using)
From source file:sf.wicklet.gwt.site.test.firefox.TestFirefox01.java
License:Apache License
@Test public void testWiki01() throws IOException { final StepWatch timer = new StepWatch(true); final FirefoxProfile profile = new FirefoxProfile(firefoxProfileDir); profile.setPreference("network.dns.disableIPv6", true); final FirefoxDriver driver = new FirefoxDriver(profile); // driver.manage().timeouts().implicitlyWait(1000, TimeUnit.MILLISECONDS); try {/*from ww w . j av a 2 s . c o m*/ debugprint(timer, "# Client start"); driver.get(BASEURL); final String title = driver.getTitle(); debugprint(timer, "# Page title is: " + title); assertEquals("Wicklet", title); findAndClick(driver.findElementById("leftTopPanel"), By.linkText("Projects")); // No edit link without login findAndCount(driver.findElementById("rightPanel"), By.linkText("Edit"), 0); // login findAndClick(driver, By.linkText("Login")); login(driver, "writer", "writer"); // findAndClick(driver.findElementById("rightPanel"), By.linkText("Edit")); waitAndCount(driver, By.cssSelector(".gwt-RichTextToolbar"), 1); findAndCount(driver, By.cssSelector("iframe.gwt-RichTextArea"), 1); takeSnapshot(driver, htmlfile("TestWiki01"), pngfile("TestWiki01")); final String top = driver.getWindowHandle(); driver.switchTo().frame("richtextarea"); waitAndCount(driver, By.tagName("h1"), 1); driver.switchTo().window(top); findAndClick(driver, By.linkText("Projects")); waitAndClick(driver.findElementById("rightPanel"), By.linkText("Edit")); waitAndCount(driver, By.cssSelector("iframe.gwt-RichTextArea"), 1); driver.switchTo().frame("richtextarea"); final List<WebElement> h3s = waitAndCount(driver, By.tagName("h3"), 7); takeSnapshot(driver, htmlfile("TestWiki01RichTextArea"), pngfile("TestWiki01RichTextArea")); final String text = h3s.get(4).getText(); assertEquals("WickletGwtServer", text); } finally { debugprint(timer, "# Client done"); if (DEBUG.isDebugServer()) { System.in.read(); } else { driver.quit(); } } }