Reputation: 13
I am trying to use fluent wait
@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);
but when I debug I got drive=null
here is where I am instanciate the driver
@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();
}
Upvotes: 0
Views: 160
Reputation: 19989
When you declare a variable it will be assigned null value by default. There is no constructor in your BaseBinariosPage that creates a driver object, how do you expect it to have a driver object.
Add something like:
public BaseBinariosPage() {
driver = new ChromeDriver()
}
Upvotes: 0