Quality is delighting customers
Tags:
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#:
Assert.IsFalse(driver.FindElementByName("Submit").Enabled);
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#:
Assert.IsTrue(driver.FindElementByName("Submit").Displayed);
Hi,
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.
Thanks,
Anand
© 2019 Created by Quality Testing.
Powered by