I'm getting an error while handling default popups with selenium scripts.
Here is the Code :
@Test
public void handlePop() {
WebElement pop1 = driver.findElement(By.xpath("//*[@id='ctl00_ContentPlaceHolder1_PopupCTRLMain_imgNext']"));
pop1.click();
WebElement pop2 = driver.findElement(By.xpath("//*[@id='ctl00_ContentPlaceHolder1_PopupCTRLMain_Image2']"));
pop2.click();
}
Following is the error I am getting while running the code:
org.openqa.selenium.NoSuchElementException: Unable to locate element: //*[@id='ctl00_ContentPlaceHolder1_PopupCTRLMain_Image2']