boolean Condition = false;
for (int second = 0; second < 60; second++) {
try {
if ((selenium.isElementPresent("//a[@id='overridelink']"))) {
selenium.click("//a[@id='overridelink']");
Condition = true;
break;
selenium.waitForPageToLoad(MAX_WAIT_TIME_IN_MS);
}
}
catch (Exception ignore) {
}
pause(1000);
}
assertTrue(Condition);
Pages
Search This Blog
Thursday, May 20, 2010
How to make selenium to wait for an element every second
Sometimes waitForPageToLoad() and pause fails then to handle this condition we just need to wait for an element we are waiting to load on the page. Once its loaded our execution should proceed.
Labels:
Selenium,
Selenium RC
Subscribe to:
Post Comments (Atom)
are bhai
ReplyDeleteThread.Sleep(2000);
use kar lo
from: anilit@in.com
I like what you guys tend to be up too. This kind of clever work and reporting!
ReplyDeleteKeep up the very good works guys I've included you guys to our blogroll.
Feel free to visit my blog; http://peskarmanak.blogspot.com