Thursday, September 27, 2012

waitForPageToLoad in Selenium 2.0/WebDriver

The following method can be used to wait until the expected page title appears.


public void waitForPageToLoad(String title){
     Integer i = 1;
     for(i=1;i<=100;i++) {
          if (driver.getTitle().equals(title)) {
               break;
          }
          Thread.sleep(10000);
     }
}
 

2 comments:

  1. Kualitatem Solutions is the best company to hire offshore QA (Quality Assurance) & automated testers and Outsource Automated & QA testing services. Automation Testing Services , Kualitatem Solutions provides expert software testing and quality assurance services.

    ReplyDelete
  2. Very interesting post! Thanks for sharing your experience suggestions. Automation Testing Service

    ReplyDelete