WebDriver driver = new ChromeDriver();
Now, when we "instantiate" Webdriver and create a reference variable and then assign the object returned to it, then does it mean that we have a new Chrome Browser session/tab open with "Default" ChromeOptions settings.
Does it mean, that when we pass the driver instance/object into a constructor or any other method in any child class, then its passing that same original object with default setting.
public class Login{
Webdriver driver;
public login(Webdriver driver)
{
this.driver = driver;
}
What is the purpose of passing a "driver" object to any method. Why not create a new Driver instance for each and every class in the project?
Thanks.