title: Error CS7036 There is no argument given that corresponds to the required formal parameter 'driver' of 'SpecflowBaseTest.SpecflowBaseTest(IWebDriver)'
body: <p>I am creating a new framework as PageFactory has been deprecated. I am getting the error</p>
  
  <pre><code>Error CS7036 There is no argument given that corresponds to the required 
  formal parameter 'driver' of 
  'SpecflowBaseTest.SpecflowBaseTest(IWebDriver)' UnitTestProject1 
  D:\Selenium 
  Projects\Olympus\UnitTestProject1\UnitTestProject1\Steps\LoginSteps.cs 14 
  Active
  </code></pre>
  
  <p>My full code snippet of my framework is below.  I am trying the dependency injection because PageFactory is deprecated, not used anymore.</p>
  
  <p>I am not sure how to resolve this error.  Some help appreciated.  Thanks</p>
  
  <p>BaseClass</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;    
  using TechTalk.SpecFlow;
  using OpenQA.Selenium;
  using OpenQA.Selenium.Chrome;
  using UnitTestProject1.Page;
  using OpenQA.Selenium.Remote;
  using BoDi;
  
  namespace UnitTestProject1
  {
  [Binding]    
  public class SpecflowBaseTest : TechTalk.SpecFlow.Steps
  {
      protected IWebDriver Driver { get; }
      protected LoginPage LoginPage { get; }
  
      public SpecflowBaseTest(IWebDriver driver)
      {
          Driver = driver;
          LoginPage = new LoginPage(driver);
      }
  
      public void NavigateToURL(string URL)
      {
          Driver.Navigate().GoToUrl(URL);
      }
  }
  } 
  </code></pre>
  
  <p>SpecflowHooksClass</p>
  
  <pre><code>using System.Text;
  using TechTalk.SpecFlow;
  using OpenQA.Selenium;
  using OpenQA.Selenium.Chrome;
  using UnitTestProject1.Page;
  using OpenQA.Selenium.Remote;
  using BoDi;
  
  namespace UnitTestProject1
  {
  public class SpecFlowHooks
  {
      private readonly IObjectContainer container;
  
      public SpecFlowHooks(IObjectContainer container)
      {
          this.container = container;
      }
  
      [BeforeStep]
      public void CreateWebDriver()
      {
          // Create and configure a concrete instance of IWebDriver
          IWebDriver driver = new ChromeDriver();
          {
  
          };
  
          // Make this instance available to all other step definitions
          container.RegisterInstanceAs(driver);
      }
  
      [AfterStep]
      public void DestroyWebDriver()
      {
          IWebDriver driver = container.Resolve&lt;IWebDriver&gt;();
  
          driver.Close();
          driver.Dispose();
      }
  }
  }
  </code></pre>
  
  <p>LoginPage Class</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Text;
  using OpenQA.Selenium;
  using SeleniumExtras.PageObjects;
  using NUnit.Compatibility;
  using Shouldly;
  using OpenQA.Selenium.Remote;
  
  namespace UnitTestProject1.Page
  {
  public class LoginPage : SpecflowBaseTest
  {
      public LoginPage(IWebDriver browser) : base(browser)
  
      {
          //Driver = browser;
      }
  
      public void Login(string Username, string Password)
      {
          UsernameField.SendKeys(Username);
          PasswordField.SendKeys(Password);
          LoginButton.Click();
      }
  
      public void CheckUserIsLoggedIn(string Username)
      {
          AccountUsername.Displayed.ShouldBe(true, Username);
      }
  
      [FindsBy(How = How.CssSelector, Using = "#LoginUsername")]
      private IWebElement UsernameField { get; set; }
  
      [FindsBy(How = How.CssSelector, Using = "#LoginPassword")]
      private IWebElement PasswordField { get; set; }
  
      [FindsBy(How = How.CssSelector, Using = "#login-submit-button")]
      private IWebElement LoginButton { get; set; }
  
      [FindsBy(How = How.CssSelector, Using = "#div.accountUsrename")]
      private IWebElement AccountUsername { get; set; }
  
  }
  }
  </code></pre>
  
  <p>Steps file</p>
  
  <pre><code>using NUnit.Framework;
  using System;
  using TechTalk.SpecFlow;
  using UnitTestProject1.Page;
  using OpenQA.Selenium;
  
  namespace UnitTestProject1.Steps
  {
  [Binding, Parallelizable]
  public class LoginSteps : SpecflowBaseTest
  {
      protected LoginPage LoginPage;
  
      public LoginSteps(LoginPage loginpage, IWebDriver driver)
      {
          //Driver = driver;
          this.LoginPage = loginpage;
      }
  
      [Given(@"I navigate to (.*)")]
      public void GivenINavigateToHttpsCompany_Com(string URL)
      {
          NavigateToURL(URL);
      }
  
      [Given(@"I enter bw_(.*) and (.*)")]
      public void GivenIEnterBw_Valid_UserAnd(string Username, string 
  Password)
      {            
          LoginPage.Login(Username, Password);
      }
  
      [Then(@"I am logged in as bw_valid_user")]
      public void ThenIAmLoggedInAsBw_Valid_User()
      {
          //LoginPage.
      }
  }
  }
  </code></pre>