Pages

Search This Blog

Monday, May 17, 2010

When selenium.waitForPageToLoad is not working

When selenium.waitForPageToLoad() is not working then we can use alternate solution.


boolean Condition = false;
for (int second = 0; second < 60; second++) {
try {
if ((selenium.isElementPresent("xpath of your element on which you want to click"))) {

selenium.click("xpath of your element on which you want to click");
Condition = true;
break;
}
}
catch (Exception ignore) {
}
pause(1000);
}
assertTrue(Condition);

No comments:

Post a Comment