title: OpenQA.Selenium.NoSuchElementException : no such element
body: <p>I am trying to automate a test case through Specflow, by using the Gherkin format, but I keep having the same error:</p>
  <blockquote>
  <p>OpenQA.Selenium.NoSuchElementException : no such element: Unable to locate element: {&quot;method&quot;:&quot;css selector&quot;,&quot;selector&quot;:&quot;*[name=&quot;customer_firstname&quot;]&quot;}</p>
  </blockquote>
  <p>The name of the textbox is customer_firstname and I do not get it why it is showing this error.</p>
  <p>The website that I am testing is:</p>
  <p><a href="http://automationpractice.com/index.php?controller=authentication&amp;back=my-account" rel="nofollow noreferrer">http://automationpractice.com/index.php?controller=authentication&amp;back=my-account</a></p>
  <p>The Gherkin file:</p>
  <pre><code>Feature: Register in the website
  
    Scenario Outline: Register a new user
      Given That I am on the Register page
      And The website will start by entering 
      | email              |
      | gti19001@demo2.com |
      When User enters their credentials
       | firstName | lastName | password     |
       | DEmo      | Demo     | 12345        |
      When The client will enter 
        | Address              | City      | State | Zip   | MobilePhone |
        | Fake adress, 12, efj | Something |     1 | 35242 | +1 5893246 4863 |
      Then Click on the register button
  </code></pre>
  <p>The Step Definition file is:</p>
  <pre><code>using OpenQA.Selenium;
  using OpenQA.Selenium.Chrome;
  using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using TechTalk.SpecFlow;
  using TechTalk.SpecFlow.Assist;
  using WebsiteTestingSpecflow.Pages;
  
  namespace WebsiteTestingSpecflow.Steps
  {
      [Binding]
      public sealed class RegisterStep
      {
  
          RegisterPage registerPage = null;
  
          [Given(@&quot;That I am on the Register page&quot;)]
          public void GivenThatIAmOnTheRegisterPage()
          {
              IWebDriver webDriver = new ChromeDriver();
              webDriver.Navigate().GoToUrl(&quot;http://automationpractice.com/index.php?controller=authentication&amp;back=my-account&quot;);
              registerPage = new RegisterPage(webDriver);
          }
  
          [Given(@&quot;The website will start by entering&quot;)]
          public void GivenTheWebsiteWillStartByEntering(Table table)
          {
              dynamic data = table.CreateDynamicInstance();
  
              registerPage.Register(data.email.ToString());
   registerPage.VerifyEmail();
          }
  
          [When(@&quot;User enters their credentials&quot;)]
          public void WhenUserEntersTheirCredentials(Table table)
          {
              dynamic data = table.CreateDynamicInstance();
  
              registerPage.RegisterCredentials(data.firstName.ToString(), data.lastName.ToString(), data.password.ToString());
          }
  
  
          [When(@&quot;The client will enter&quot;)]
          public void WhenTheClientWillEnter(Table table)
          {
              dynamic data = table.CreateDynamicInstance();
  
              registerPage.RegisterInformation(data.Address.ToString(), data.City.ToString(), data.State.ToString(), data.Zip.ToString(), data.MobilePhone.ToString());
          }
  
          [Then(@&quot;Click on the register button&quot;)]
          public void ThenClickOnTheRegisterButton()
          {
              registerPage.RegisterBtn();
          }
      }
      }
  </code></pre>
  <p>And the file where the functions are implemented are:</p>
  <pre><code>using OpenQA.Selenium;
  using System;
  using System.Collections.Generic;
  using System.Text;
  
  namespace WebsiteTestingSpecflow.Pages
  {
      class RegisterPage
      {
          public IWebDriver Webdriver { get; }
  
          public RegisterPage(IWebDriver webDriver)
          {
              Webdriver = webDriver;
          }
  
  
          //UI Elements of Registration
          public IWebElement txtEmailRegister =&gt; Webdriver.FindElement(By.Name(&quot;email_create&quot;));
  
          public IWebElement btnRegisterVerify =&gt; Webdriver.FindElement(By.CssSelector(&quot;#SubmitCreate &gt; span&quot;));
  
          public IWebElement txtName =&gt; Webdriver.FindElement(By.Name(&quot;customer_firstname&quot;));
  
          public IWebElement txtSurname =&gt; Webdriver.FindElement(By.Name(&quot;customer_lastname&quot;));
  
          public IWebElement txtPassword =&gt; Webdriver.FindElement(By.Name(&quot;passwd&quot;));
  
          public IWebElement txtAddress =&gt; Webdriver.FindElement(By.Name(&quot;address1&quot;));
  
          public IWebElement txtCity =&gt; Webdriver.FindElement(By.Name(&quot;city&quot;));
  
          public IWebElement txtState =&gt; Webdriver.FindElement(By.Name(&quot;id_state&quot;));
  
          public IWebElement txtZIP =&gt; Webdriver.FindElement(By.Name(&quot;postcode&quot;));
  
          public IWebElement txtPhone =&gt; Webdriver.FindElement(By.Name(&quot;phone_mobile&quot;));
  
          public IWebElement btnRegister =&gt; Webdriver.FindElement(By.CssSelector(&quot;#submitAccount &gt; span&quot;));
  
  
          public void Register(string Email)
          {
              txtEmailRegister.SendKeys(Email);
              
          }
  
          public void RegisterCredentials(string Username, string Lastname, string password)
          {
  
              txtName.SendKeys(Username);
              txtSurname.SendKeys(Lastname);
              txtPassword.SendKeys(password);
          }
  
          public void RegisterInformation(string address, string city, string State, string zip, string phone)
          {
              txtAddress.SendKeys(address);
              txtCity.SendKeys(city);
              txtState.SendKeys(State);
              txtZIP.SendKeys(zip);
              txtPhone.SendKeys(phone);
          }
  
          public void VerifyEmail() =&gt; btnRegisterVerify.Submit();
  
          public void RegisterBtn() =&gt; btnRegister.Submit();
      }
  }
  </code></pre>
  <p>The test output:</p>
  <p><a href="https://i.stack.imgur.com/9bJTI.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9bJTI.jpg" alt="enter image description here" /></a></p>
  <p>Does anybody know why this may be happening?</p>
  <p>Thank you in advance.</p>