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);

2 comments:

  1. Thanks for sharing great information in your blog. Got to learn new things from your Blog . It was very nice blog to learn about Selenium.
    Selenium

    ReplyDelete
  2. It was very nice blog to learn about Selenium.Thanks for sharing new things.selenium training in chennai

    ReplyDelete