Hi Sirus,
In selenium RC we have a method setSpeed(timeout) which slow down your every selenium command or method. But as per my knowledge there is no equivalent method available in webdriver. So we are enforced to write explicit wait methods. Consider following items
1. We cannot assume that all the elements are loaded, if page is loaded. This means even if the page is loaded you cannot assume that every element on the page is loaded. To handle this we need to wait for that element to loaded. This can be achieved by using explicit wait method. You have to write a custom method waitForElementPresent(String locator) with the following pseudo code:
void waitForElementPresent(String locator){
for (int second = 0;; second++) {
if (second >= 60) fail("timeout");
try { if (isElementPresent(By.xpath(""))) break; } catch (Exception e) {}
Thread.sleep(1000);
}
//Method for isElementPresent(By by)
boolean isElementPresent(By by){
private boolean isElementPresent(By by) {
try {
driver.findElement(by);
return true;
} catch (NoSuchElementException e) {
return false;