How to add explicit wait in PageFactory in PageObjectModel?

When using PageFactory in PageObjectModel if you expect the element to be loaded through some JavaScript and it might not be present on the page already you can use the Explicit Wait support with a normal locator factory as follows: Code Block: package com.pol.zoho.PageObjects; import org.openqa.selenium.By; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.support.FindBy; import org.openqa.selenium.support.PageFactory; import … Read more

StaleElementReference Exception in PageFactory

StaleElementReferenceException StaleElementReferenceException extends WebDriverException and indicates that the previous reference of the element is now stale and the element reference is no longer present on the DOM of the page. Common Reasons The common reasons behind facing StaleElementReferenceException are as follows: The element has been deleted entirely. The element is no longer attached to the … Read more