title: Using "not" in selenium xpath
body: <p>I have two buttons:</p>
  
  <p><strong>BUTTON1</strong>: </p>
  
  <pre><code>&lt;button id="pt1:r1:0:pt1:refresh" class="x28x x7j p_AFTextOnly" onclick="return false;"&gt;
  REFRESH
  &lt;span id="pt1:r1:0:pt1:j_id__ctru171pc2" class="x283 x18k"&gt;&lt;/span&gt;
  &lt;/button&gt;
  </code></pre>
  
  <p><strong>BUTTON2</strong>:</p>
  
  <pre><code>&lt;button id="pt1:r1:0:pt1:refreshFileAttachments" class="x28x x7j p_AFTextOnly" onclick="return false;"&gt;
  REFRESH
  &lt;span id="pt1:r1:0:pt1:j_id__ctru370pc2" class="x283 x18k"&gt;&lt;/span&gt;
  &lt;/button&gt;
  </code></pre>
  
  <p>So to distinguish them I use</p>
  
  <p><strong>BUTTON1</strong>: <code>//button[contains(@id,'refresh') and not contains(@id,'refreshFile')]</code></p>
  
  <p><strong>BUTTON2</strong>: <code>//button[contains(@id,'refreshFileAttachments')]</code></p>
  
  <p>One page should NOT have these buttons.  I verified that.
  Another page should have these buttons.  When I tried verifying, it could not find BUTTON1.  I verified using inspect that both buttons and there, and viewing them on the screen they are both visible.</p>
  
  <p>So what did I do wrong?  Can you not use not contains?  An alternative.  I know there is a starts-with(@id,...) but there is no ends-with(@id,...).</p>
  
  <p>Any thoughts?</p>