title: Selenium - Wait until returned javascript script value match value
body: <p>I need to wait until the result of a javascript match a string or a boolean value. </p>
  
  <p>With this javascript:</p>
  
  <pre><code>document.getElementById('video_html5').seeking;
  </code></pre>
  
  <p>I get a "false" / "true" value, and i need to wait until the value is "false", so I'm sure that the video is not seeking, but I only found the way to wait for a javascript command value and not the way to check that the value matches some text.</p>
  
  <pre><code>new WebDriverWait(driver, 30)
      .until(ExpectedConditions.jsReturnsValue("return document.getElementById('video_html5').seeking;"));
  </code></pre>
  
  <p>Because in some cases I get a string other than boolean and need to compare those strings.</p>
  
  <p>I have found how to do it in Ruby but not in Java:</p>
  
  <pre><code>wait_element = @wait.until { @driver.execute_script("return document.getElementById('vid1_html5_api_Shaka_api').seeking;").eql? false }
  </code></pre>