title: .NET Tests with Selenium, headless Chrome error
body: <p>I've been trying to implement headless browser to my tests and I'm getting an error message that shows me this: "Unable to locate element: {"method":"id","selector":"my_id"}". This is the code that I'm working with:</p>
  
  <pre><code>[TestFixture]
  class ClientesSystemTest
  {
      private ChromeOptions options;
      private NewClientesPage page;
      private IWebDriver driver; 
      public ClientesSystemTest()
      {
          options = new ChromeOptions();
          options.AddArgument("--headless");
          driver = new ChromeDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options);
          page = new NewClientesPage(driver);
      }
  
      [Test]
      public void CadastraCliente()
      {
          page.Visita();
          page.Cadastra("Paulo", "Guedes", "00870021087", "Rua abcdwxyz, 14", 15);
          driver.Close();
      }
  }
  </code></pre>
  
  <p>and this is the Cadastra method.:</p>
  
  <pre><code>public void Cadastra(string nome, string sobrenome, string cpf, string endereco, int idade)
      {
          IWebElement nomeCliente = driver.FindElement(By.Id("Nome"));
          IWebElement sobrenomeCliente = driver.FindElement(By.Id("Sobrenome"));
          IWebElement cpfCliente = driver.FindElement(By.Id("CPF"));
          IWebElement enderecoCliente = driver.FindElement(By.Id("Endereco"));
          IWebElement idadeCliente = driver.FindElement(By.Id("Idade"));
          IWebElement estadoCivilCliente = driver.FindElement(By.Name("EstadoCivil"));
          driver.FindElement(By.CssSelector("[value=Divorciado]")).Click();
  
          nomeCliente.SendKeys(nome);
          sobrenomeCliente.SendKeys(sobrenome);
          cpfCliente.SendKeys(cpf);
          enderecoCliente.SendKeys(endereco);
          idadeCliente.SendKeys(idade.ToString());
          nomeCliente.Submit();
      }
  </code></pre>
  
  <p>I've tried everything by this point. The test runs normally without the headless feature. Does anyone have a solution for this error? Thanks.</p>