Customising the Selenium Java Junit4 Webdriver exporter
public boolean isTextPresent(WebDriver driver, String textToCheck){ try { org.openqa.selenium.By by = By.xpath("//p[contains(.,'"+textToCheck+"')]")); driver.findElement(by); return true; } catch (NoSuchElementException e) { return false; }}
To check the result of the Selenium Unit Testing : use firebug.