title: Asserts not seeing element when using C#, Selenium web-driver, and NUnit
body: <p>I am trying to write a test script for a website. I want to use the assert to verify the element is on the page before the next line of code runs, calling that element. </p>
  
  <p>I am using a try/catch block with the assert. The assert can not see the element by Id or Xpath. It fails and the catch grabs it. 
  Here is the fun part: The next line of code uses the same web element by Id or Xpath and it works. This has me stumped. </p>
  
      
  
  <pre><code>    class Program
      {
          static void Main(string[] args)
          {
              var driver = new ChromeDriver();
              driver.Navigate().GoToUrl("https://www.higgins3.com/");
              System.Threading.Thread.Sleep(2000);
              //Assert try catch block to see if search box is one the page.
              try
              {
                  Assert.IsTrue(driver.FindElement(By.Id("s")).Displayed);
                  Console.Write("Search box display . assert Pass");
              }
              catch (Exception e)
              {
                  Console.WriteLine("Can not find Search Box . assert Fail");
              }
              // End Assert
  
              IWebElement element1 = driver.FindElement(By.Id("s"));
              System.Threading.Thread.Sleep(2000);
              element1.Click();
              element1.SendKeys("Printer");
              System.Threading.Thread.Sleep(2000);
          }
      }
  </code></pre>