No matter what search type I use, I always get "no such element found" error. Why does this happen?
public void CorrectPIN() throws InterruptedException{
driver.findElement(By.id("identifier")).sendKeys("abhisingh1313@mailinator.com");
driver.findElement(By.id("button")).click();
Thread.sleep(5000);
do {
Thread.sleep(100);
} while (driver.findElement(By.id("pin")).isDisplayed());
}
..................
I am getting unable to locate element on driver.findElement(By.id("pin")).isDisplayed())
no matter what search mechanism I use. I have tried even xpath.
basically I want the webdriver to wait until an element is present on screen and it does but even then I don't know why it gives error unable to locate the element error.