I am trying to find if the button element is clickable which I am not able to validate successfully using selenium webdriver.
Here is my code to validate if the element is clickable
boolean installAFile;
String classValues = driver.findElement(by.XPATH("//button[contains(., 'Install a new file')]")).getAttribute("class");
installAFIle = classValues.contains("iconbutton-button--clickable");
return installAFIle;
Here is the HTML
<div>
<!-- react-text: 406 -->
test message 1
<!-- /react-text -->
<div class="iconbutton">
<button class="iconbutton-button iconbutton-button--clickable" type="button"
tabindex="0">
<div class="iconbutton-button-label">Install a new file</div>
</button>
</div>
<!-- react-text: 410 -->
under File > Install.
<!-- /react-text -->
</div>
I keep on getting following validation message: no such element: Unable to locate element: {"method":"xpath","selector":"//button[contains(., 'Install a new file')]"}
linkis always aLINKwhich must be clickable. Hence your question makes no sense to me. Can you update the Question with your exact usecase and manual steps you are trying to perform? Thanks