Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save prashanth-sams/5500545 to your computer and use it in GitHub Desktop.
Save prashanth-sams/5500545 to your computer and use it in GitHub Desktop.
iFrames- Finding presenceOfElementLocated (Expected Condition) & Timeout set to 5 secs
driver.manage().timeouts().implicitlyWait(5, TimeUnit.SECONDS);
@Test
public void test() throws Exception {
try{
driver.switchTo().frame(driver.findElement(By.cssSelector("iframe[id='**********']")));
new WebDriverWait(driver, 5)
.until(ExpectedConditions.presenceOfElementLocated(By.cssSelector("**********")));
System.out.println("Element found");
}catch (TimeoutException e) {
System.out.println("Element not Found");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment