title: Explicit wait exception c# selenium
body: <p>I'm new to using Explicit wait within my code. In my code I previously had Implicit waits but I now want to use Explicit waits. I've tried to use the same concept as I had for Implicit waits but I get an exception for my <code>SelectElementFromDropDown</code>. The error is specifically thrown with 'country' and 'currency' </p>
  
  <p>I've commented out my code that was previously working. </p>
  
  <p>I've followed this example</p>
  
  <pre><code>    WebDriverWait wait = new WebDriverWait(driver, TimeSpan.FromSeconds(5));
  IWebElement button = wait.Until(ExpectedConditions.ElementExists(By.Id("someId"));
  </code></pre>
  
  <p>/</p>
  
  <pre><code>    using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Threading.Tasks;
  using OpenQA.Selenium;
  using OpenQA.Selenium.Chrome;
  using OpenQA.Selenium.Support.UI;
  using OpenQA.Selenium.Interactions;
  using System.Threading;
  
  namespace Exercise1
  {
      class test3
      {
  
          static void Main(string[] args)
          {
              IWebDriver webDriver = new ChromeDriver();
              webDriver.Navigate().GoToUrl("http://www.asos.com/men/");
              webDriver.Manage().Window.Maximize();
              webDriver.FindElement(By.XPath(".//button[@data-testid='country-selector-btn']")).Click();
  
              WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(5));
              IWebElement button = wait.Until(ExpectedConditions.ElementExists(By.Id("country")));
              SelectElementFromDropDown(country, "India");
  
  
              //webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(5);
              //IWebElement country = webDriver.FindElement(By.Id("country"));
              //SelectElementFromDropDown(country, "India");
  
              WebDriverWait wait = new WebDriverWait(webDriver, TimeSpan.FromSeconds(5));
              IWebElement element = wait.Until(ExpectedConditions.ElementExists(By.Id("currency")));
              SelectElementFromDropDown(currency, "$ USD");
  
              //IWebElement currency = webDriver.FindElement(By.Id("currency"));
              //SelectElementFromDropDown(currency, "$ USD");
  
              webDriver.FindElement(By.XPath(".//button[@data-testid='save-country-button']")).Click();
  
              webDriver.Quit();
  
          }
  
          private static void SelectElementFromDropDown(IWebElement ele, string text)
          {
              SelectElement select = new SelectElement(ele);
              select.SelectByText(text);
          }
  
  
      }
  }
  </code></pre>