I have two buttons:
BUTTON1:
<button id="pt1:r1:0:pt1:refresh" class="x28x x7j p_AFTextOnly" onclick="return false;">
REFRESH
<span id="pt1:r1:0:pt1:j_id__ctru171pc2" class="x283 x18k"></span>
</button>
BUTTON2:
<button id="pt1:r1:0:pt1:refreshFileAttachments" class="x28x x7j p_AFTextOnly" onclick="return false;">
REFRESH
<span id="pt1:r1:0:pt1:j_id__ctru370pc2" class="x283 x18k"></span>
</button>
So to distinguish them I use
BUTTON1: //button[contains(@id,'refresh') and not contains(@id,'refreshFile')]
BUTTON2: //button[contains(@id,'refreshFileAttachments')]
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.
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,...).
Any thoughts?