Pages

Sunday, 18 December 2011

When selenium.waitForPageToLoad is not working


When selenium.waitForPageToLoad() is not working the 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