title: Unable to find method for detecting if element exists on a page
body: <p>I'm very new to Watir.</p>
  
  <p>I have a bit of Ruby/Watir code that is supposed to detect if an element, exists, and if so, click it, if not, click a different element.  Both elements, show up, every time.  Unfortunately nothing I've tried works.</p>
  
  <pre><code>if browser.contains_text("/media/images/icons/reviewertools/editreview.jpg")
  then browser.image(:src =&gt; "/media/images/icons/reviewertools/editreview.jpg").click
  else browser.image(:src =&gt; "/media/images/icons/reviewertools/savereview.jpg").click
  end
  </code></pre>
  
  <p>This eventually fails with "Unable to locate element, using {:src=>"/media/images/icons/reviewertools/savereview.jpg"} (Watir::Exception::UnknownObjectException)"</p>
  
  <p>It should have clicked /editreview.jpg, which was visible.</p>
  
  <p>I have also tried:</p>
  
  <pre><code>if browser.image("/media/images/icons/reviewertools/savereview.jpg").exists
  then browser.image(:src =&gt; "/media/images/icons/reviewertools/savereview.jpg").click
  </code></pre>
  
  <p>as well as:</p>
  
  <pre><code>if browser.image("/media/images/icons/reviewertools/savereview.jpg").exists?
  </code></pre>
  
  <p>Note that NONE of these cases detect the element, or failing to do that, execute the else clause.</p>
  
  <p>Please, if you respond, provide specific code examples for your suggestions.</p>