title: How to add custom ExpectedConditions for Selenium?
body: <p>I'm trying to write my own ExpectedConditions for Selenium but I don't know how to add a new one. Does anyone have an example? I can't find any tutorials for this online.</p>
  
  <p>In my current case I want to wait until an element exists, is visible, is enabled AND doesn't have the attr "aria-disabled". I know this code doesn't work:</p>
  
  <pre><code>var wait = new WebDriverWait(driver, TimeSpan.FromSeconds(seconds));
  return wait.Until&lt;IWebElement&gt;((d) =&gt;
      {
          return ExpectedConditions.ElementExists(locator) 
          &amp;&amp; ExpectedConditions.ElementIsVisible 
          &amp;&amp;  d.FindElement(locator).Enabled 
           &amp;&amp; !d.FindElement(locator).GetAttribute("aria-disabled")
      }
  </code></pre>
  
  <p>EDIT: A little additional info: the problem I am running into is with jQuery tabs. I have a form on a disabled tab and it will start filling out fields on that tab before the tab becomes active.</p>