title: Best way to find out if jqGrid is loaded and ready with Selenium
body: <p>How are you finding out if jqGrid is loaded and ready to be used, via selenium.</p>
  
  <p>Some details :</p>
  
  <ul>
  <li>Im using C# driver</li>
  <li>I have a method : <code>new WebDriverWait(driver, new TimeSpan(0, 0, 0, 30)).Until(x =&gt; loadingdissapearedcondition)</code> which im using to wait until Loading.. element is gone.</li>
  <li>I also sometimes use this script :</li>
  </ul>
  
  <p><code>private const string script = @"return ($('#{0}').jqGrid('getGridParam', 'reccount') !=x undefined) &amp;&amp; ($('#{0}').jqGrid('getGridParam', 'reccount') != 0) &amp;&amp; (!$('#load_{0}').is(':visible')) &amp;&amp; (!$('#busyIcon').is(':visible'))";</code></p>
  
  <pre><code>private readonly string waitScript;
  
  waitScript = string.Format(script, jqGridId);
  
  public void WaitUntilLoadIconDissappears()
  {
      driver.WaitUntil(MAXWAIT, Wait);
  }
  
  public bool Wait()
  {
      var executeScript = ((IJavaScriptExecutor) driver).ExecuteScript(waitScript);
      bool result;
      bool tryParse = bool.TryParse(executeScript.SafeToString(), out result);
      return tryParse &amp;&amp; result;
  }
  </code></pre>
  
  <p>to find if jqGrid has records and loading done.</p>
  
  <p>I require something better - as even the above two does not make driver wait until load finishes, if we are using local data for jqGrid. Im also curious what is the best way, or at the minimum, how others are dealing with this problem.</p>