我想用流利的语言等等
@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();
}
1条答案
按热度按时间vpfxa7rd1#
当您声明一个变量时,默认情况下它将被赋值为空值。basebinariospage中没有创建驱动程序对象的构造函数,您希望它如何拥有驱动程序对象。
添加如下内容: