I am passing a WebDriver instance to the class below as
FunctionalComponents fc = new FunctionalComponents(driver)
from another class, but the object creation happens before constructor is executed. As it is, the objects created are having null value in the driver instance.
How can I solve this problem?
public class FunctionalComponents
{
public FunctionalComponents(WebDriver driver)
{
this.driver = driver;
}
CaptureElement element= new CaptureElement(driver);
public void Method()
{
// method logic
// i call object element here
}
}