the issue happens on a homePage but you provided a screenshot of a BasePage only, so it is only my guess of what the issue is
public class BaseTest
{
}
public class MyTestSets : BaseTest
{
[Test]
public void MyTest()
{
MyPage page = new MyPage(driver, wati);
page.PerfromAction();
}
}
public class MyPage : BasePage
{
public MyPaget(driver, wait):base(driver, wait);
}
public class BasePage
{
private IWebDeriver driver;
private IWebDriverWait wait;
public BasePage(driver, wait)
{
driver = driver;
wait = wait;
}
}
Let me explain this code-
First you initialize your driver - it is not in this example, I assume that would be done in a BaseTest class
Then, since MyTestSet class inherits from BaseTest it will automatically can contain your driver as a result you can pass driver and wait when you create an instance of YourPage
Since YourPage inherit from BasePage which accepts 2 arguments(driver and wait) you need to provide these 2 arguments which you can do by :base(driver, wait)
As a result you can use not driver and wait in your BasePage. if you do not provide it, you cannot use. This about this just like giving a fork to someone. If you need to it and ask me for a fork untill I give it to you, you cannot have your meal. Same here, untill your provide a driver to your class, you cannot use it in your class
Looking at your example, it think this what you are trying to do
private static T GetPage<T>(IWebDriver driver) where T : new()
{
var page = Activator.CreateInstance(typeof(T), new object[] { driver });
PageFactory.InitElements(driver, page);
return (T)page;
}
Hope that will help