How to wait for invisibility of an element through PageFactory using Selenium and Java
问题 Is there a way to wait for an element not present in Selenium using PageFactory annotations? When using: @FindBy(css= '#loading-content') WebElement pleaseWait; to locate the element, and then: wait.until(ExpectedConditions.invisibilityOfElementLocated(pleaseWait)); I would get: org.opeqa.selenium.WebElement cannot be converted to org.openqa.selenium.By I am able to do what I need by using: wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector('loading-content'))); However