title: After handling Alert and waits,The page is not loading and cannot locate elements. (in Selenium)
body: <p><strong>After handling Alert and waits(popup at runtime,</strong>)The page is not loading which is why cannot locate elements. (in Selenium)getting  <strong>no such element: Unable to locate element</strong>:</p>
  <p>''''public class ApplicantLoginPageTest extends TestBase{</p>
  <pre><code>  @Test
      public void init() throws Exception { 
        
       
      ApplicantLoginPage applicantLoginPage = PageFactory.initElements(driver, ApplicantLoginPage.class);
      
        applicantLoginPage.getApp(prop.getProperty(&quot;urlapp&quot;));
        Thread.sleep(3000);
        
        applicantLoginPage.login(prop.getProperty(&quot;un&quot;));
        Thread.sleep(3000);
              
        applicantLoginPage.instruct1();
        Thread.sleep(3000);
        
        applicantLoginPage.TestClick();
        try {
              WebDriverWait wait = new WebDriverWait(driver, 2);
              wait.until(ExpectedConditions.alertIsPresent());
              Alert alert = driver.switchTo().alert();
              alert.accept();
              driver.switchTo().defaultContent();
          } catch (Exception e) {
          }
           applicantLoginPage.TestCamera();
          Thread.sleep(15000);
          applicantLoginPage.PreviewRecord();
          Thread.sleep(15000);
          applicantLoginPage.instruct2();
          Thread.sleep(3000);
      }
  }''''
  </code></pre>