title: Selenium: How to use stored value in a javascript comparison
body: <p>I've searched around for the answer to this and found lots of much
  more complicated questions, but none that gave me insight enough to
  figure this one out.<br>
  What I'm doing:<br>
  1- open a page with a number that will probably be large<br>
  2- get the X Path to where that number is and store it to a variable<br>
  3- do a javascript to compare the above stored variable to see if it is bigger than 10, if so, set a new variable to true; else false (because that is the default value)<br>
  4- verify the variable in #3 is true  </p>
  
  <p>Sounds simple enough, no?  </p>
  
  <p>Where it goes wrong:<br>
  At step 3, comparing the variable from step #2 to 10 isn't allowed, at least not the way I'm writing it.</p>
  
  <p>Why?</p>
  
  <p>Details:</p>
  
  <pre><code>&lt;tr&gt;
     &lt;td&gt;open&lt;/td&gt;
     &lt;td&gt;http://www.google.com/search?hl=en&amp;q=selenium+verifyEval&lt;/td&gt;
     &lt;td&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
     &lt;td&gt;store&lt;/td&gt;
     &lt;td&gt;/html/body/div[5]/div/p/b[3]&lt;/td&gt;
     &lt;td&gt;resultCount&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
     &lt;td&gt;storeEval&lt;/td&gt;
     &lt;td&gt;var isMoreThan10 = new Boolean(); isMoreThan10 = (resultCount &amp;gt; 10);&lt;/td&gt;
     &lt;td&gt;isMoreThan10&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
     &lt;td&gt;verifyExpression&lt;/td&gt;
     &lt;td&gt;${isMoreThan10}&lt;/td&gt;
     &lt;td&gt;true&lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>I just thought of one possible workaround: Expand the javascript code to get the value there &amp; assign it to a variable there so I'll be more likely to be able to use that variable in the javascript. Not sure exactly how that would be done- anyone wanna help with that?  </p>
  
  <p>But surely there is be a better way, isn't there? I must be able to assign a value to a variable in Selenium, then in the next line use that variable in a javascript, right?</p>