Skip to main content
6 of 7
Clean up. Please put more work into formatting your questions and checking spelling and formatting.
c32hedge
  • 2.7k
  • 19
  • 39

How to select and click the first enabled button?

enter image description here

I am currently changing my XPath every time to click on the enable (Qualification check) button. However, I want to click on the first button that is in the enabled state. I have a total of 10 buttons out of which some are enabled and some are disabled. How can I find and click the first enabled button?

HTML element code:

<div>
    <button type="button" id="btnQualificationCheck_3" 
            style="padding-left:15px; padding-right:15px;" 
            class="btn btn-primary btn-sm btn-fill qualifier" 
            disabled="">Qualification Check</button>
</div>
<div>
    <button type="button" id="btnQualificationCheck_4" 
            style="padding-left:15px; padding-right:15px;" 
            class="btn btn-primary btn-sm btn-fill qualifier">Qualification Check</button>
</div>
Anupam Sahu
  • 49
  • 1
  • 2
  • 6