I am trying to click on button only if it is enabled, if the button is disabled i would not click on the button and proceed further.
When i write the Xpath and check if the webElement is Enabled, resulting in Enabled always and i dont see much difference in html as well to differential between enabled and disabled.
Help me with writing the xpath which should work only when the element is Enabled.
I have tried to below xpath : //button[NOT(@disable) and span[text()='More Steps']]
Above xpath is not working.
When the element is Enabled :
<button class="slds-button slds-button--neutral showMoreButton uiButton" aria-live="off" type="button" data-aura-rendered-by="2703:0" data-aura-class="uiButton"><!--render facet: 2704:0--><span class=" label bBody" dir="ltr" data-aura-rendered-by="2706:0">More Steps</span><!--render facet: 2708:0--></button>
<span class=" label bBody" dir="ltr" data-aura-rendered-by="2706:0">More Steps</span>
When the element is Disabled :
<button class="slds-button slds-button--neutral showMoreButton uiButton" aria-live="off" type="button" disabled data-aura-rendered-by="2703:0" data-aura-class="uiButton"><!--render facet: 2704:0--><span class=" label bBody" dir="ltr" data-aura-rendered-by="2706:0">More Steps</span><!--render facet: 2708:0--></button>
<span class=" label bBody" dir="ltr" data-aura-rendered-by="2706:0">More Steps</span>
Actual : When the element is not disabled, User is able to click on that but when it is disabled still user is trying to click that
Expected : User should be able to click on the element only when it is Enabled
Note : Do not mark the question as duplicate, this is with respect to salesforce tags, please understand.
THanks in advance for your suggestions/Solutions