title: How to access newly opened page in same tab using selenium webdriver
body: <p>I am unable to access the newly opened page after submitting a form in same tab (not in new tab). I am a newbie in selenium driver, please help me.</p>
  
  <p>In-fact, I accessed first page and filled form successfully, and then I clicked a submit button and proceed to next page, opened in same tab. But then I failed to access that newly opened page.</p>
  
  <p>I also use 10 sec explicit wait to manage form submission and new page opening time but doesn't working. I didn't use WindowHandles() because I am not comfortable to use that. Will Windowhandles() work ?</p>
  
  <p>Only one way I am able to access new page by using separately navigate().to() method after clicking submit button. But is this good approach to get control at new page rather than automating control to new page by some other way ?</p>
  
  <p>I used following explicit wait and then accessed a button at newly page, but doesn't working:</p>
  
  <pre><code>WebDriverWait WaitVar = new WebDriverWait (driver, 10);
  WaitVar.until(ExpectedConditions.visibilityOfElementLocated(By.id("BTNCustomQuestionFinalStep")));
  driver.findElement(By.id("BTNCustomQuestionFinalStep")).click();
  </code></pre>
  
  <p>Without using explicit wait I got following error:</p>
  
  <blockquote>
    <p>no such element: Unable to locate element</p>
  </blockquote>
  
  <p>After using explicit wait I got following error:</p>
  
  <blockquote>
    <p>Expected condition failed: waiting for visibility of element located by By.id: BTNCustomQuestionFinalStep (tried for 10 second(s) with 500 milliseconds interval)</p>
  </blockquote>