Quality is delighting customers
Assuming I am understanding your question correctly (I apologize if I am not), if you are using Selenium, and you are trying to verify that the button is disabled/enabled, there is a built in property for this. Here is an example of how that assertion would look using Selenium in C#:
If you are simply trying to verify of the button is present on the page, there is also a built in property for that. Here is an example of how that assertion would look using Selenium in C#:
If you are using Selenium WebDriver , java (common combination being used in most of the automation and qa services companies), you can use the following:
WebElement we = driver.findElementById("Disabled Element Id");
boolean actualValue = we.isEnabled();
Assert.assertEquals(False , actualValue);
Hope it helps.