Click on a link triggers an operation that creates new element. However, calling driver.findElement(By.id(""))
after click returns does not find it.
I have tried the following code to wait for the element to appear.
wait.until(new ExpectedCondition()
{
public Boolean apply(WebDriver webDriver) {
System.out.println("Searching ...");
return webDriver.findElement(By.id("itemType1")) != null;
}
});
But I still can't find it until timeout.