I have created one element using page factory class.
@Findby(how=How.ID,using="userName")
private WebElement userName;
//Adding explicit wait here
WebDriverWait wait = new WebDriverWait(driver,30);
wait.until(ExpectedConditions.visibilityOf(userName)); // It is taking long time to wait even though the web element presents in the DOM
If I use, below statement the web driver responds immediately when webelement presents in DOM.
wait.until(ExpectedConditions.visibilityOf(driver.findElement(By.id("userName")));
Same issue with other explicit wait methods also.
This is my observation. Any idea to resolve this would help me. Thanks!