我正在尝试使用流利的等待
@Component
@Scope(SCOPE_CUCUMBER_GLUE)
public class UserCreationPageImpl extends BaseBinariosPage implements UserCreationPage {
Wait<WebDriver> wait = new FluentWait<WebDriver>( driver )
.withTimeout(Duration.ofSeconds(30))
.pollingEvery(Duration.ofSeconds(5))
.ignoring(NoSuchElementException.class);
但是当我调试时,我得到了 drive=null
这是我实例化驱动程序的地方
@Page
public abstract class BaseBinariosPage {
@Autowired
protected WebDriver driver;
@Autowired
private QAStarterConfigProperties qaStarterConfigProperties;
public BaseBinariosPage() {
}
@Init
public void init() {
this.driver.get(this.qaStarterConfigProperties.getAppUrl() + this.getPageEndPoint());
PageFactory.initElements(this.driver, this);
}
protected abstract String getPageEndPoint();
}