class LoginPage(){
///line of code
}
public LoginPage(WebDriver driver) {
this.driver = driver;
PageFactory.initElements(driver, this);
}
Can any onesomeone please explain the constructor part of the code. Why doI don't understand why we declare a constructor and pass the driver instance here.
What ismakes passing the use of itdriver into the constructor such a common pattern?