RE: Browser Factory or WebDriver Factory Tutorial
Near the end of the Browser Factory or WebDriver Factory Tutorial (http://toolsqa.com/selenium-webdriver/c-sharp/browser-factory-or-webdriver-factory/), there is a code block titled “LogInTest TestCase”. Inside that code snippet there is a variable named “driver” used and I don’t see where it is coming from? There is no BaseTest it is inherited from? What am I missing?
I’m trying to implement the BrowserFactory and PageFactory patterns, but I’m not sure where the IWebDriver should come from that is passed into the Page constructor.
Forgive me if it is incorrect to ask follow up questions, but I have a problem with this tutorial as well.
Whenever I run the logintest I am always presented with the exception (“The WebDriver browser instance was not initialized”)…
LoginTest calls InitBrowser, which checks if Driver is Null – Attempts to get Driver which checks if _driver is Null, which it always will be… and then throws the exception. Have I misunderstood, or is there an error in the tutorial?