How to explicitly wait while using page factory in Selenium?
问题 I'm going to organize an explicit wait in Selenium like this: WebDriverWait = new WebDriverWait(driver,30); WebElement element = wait.until(ExpectedConditions.presenceOfElementLocated(locator)); The problem is that I don't have the driver in my class, because I used the PageFactory, not a constructor in a test class: MyClass myform = PageFactory.InitElements(driver, MyClass.class) What is a good decision to organize explicit wait in this case? 回答1: I would suggest that you use the PageFactory