title: handling javaScript alerts when running a selenium test?
body: <p>I am am running some selenium tests(ruby) on my web page and as i enter an invalid characters in to a text box i have the JavaScript throw a alert like so</p>
  
  <pre><code>if(isNaN($(this).val()) || Number($(this).val().valueOf() &lt;=0)){
      alert("Please Enter A Number");
  }
  </code></pre>
  
  <p>how can i handle this alert when its made and close the pop up? </p>
  
  <p>i tried to use the <code>wait_for_pop_up()</code> and <code>close()</code> but i think that's only for browser pop up's and not JavaScript alerts.</p>
  
  <p>any ideas?</p>
  
  <p>thanks</p>