title: Selenium Wait for element value to load
body: <p>I have looked at similar questions but I did not get the help I needed, I hope this is not a duplicate...</p>
  
  <p>I would like selenium to wait for selenium to wait for a specific value. 
  Or to wait while some javascript is running.</p>
  
  <p>Here is an example:
  Page object</p>
  
  <pre><code>class Converter
  {
      private IWebDriver _webDriver;
  
      [FindsBy(How = How.Id, Using = "tabin")]
      public IWebElement HexVaue { get; set; }
  
      [FindsBy(How = How.Id, Using = "resulttxt")]
      public IWebElement DecimalValue { get; set; }
  
      [FindsBy(How = How.CssSelector, Using = "#content &gt; form &gt; input[type='button']")]
      public IWebElement ConvertButton { get; set; }
  
      public Converter(IWebDriver webDriver)
      {
          _webDriver = webDriver;
  
          PageFactory.InitElements(_webDriver, this);
      }
  </code></pre>
  
  <p>Test code:</p>
  
  <pre><code>        _driver = new FirefoxDriver();
          _driver.Navigate().GoToUrl("http://www.binaryhexconverter.com/hex-to-decimal-converter");
          _converter = new Converter(_driver);
          _converter.HexVaue.SendKeys("100");
          _converter.ConvertButton.Click();
          var wait = new WebDriverWait(_driver, TimeSpan.FromSeconds(5));
          // Assert.AreEqual("256", _converter.DecimalValue.GetAttribute("value")); // Fails
          wait.Until(d =&gt; _converter.DecimalValue.GetAttribute("value").Equals("256"));
  </code></pre>
  
  <p>If I do a typical NUnit assert without this wait.Until, then the test fails. Is this the correct way for me to do this assertion in Selenium?</p>
  
  <p>Thanks, Daryn</p>