Quality Testing

Quality is delighting customers

How to verify a disabled button showing on a page or not?

How to verify a disabled button showing on a page or not using Selenium WebDriver?

Views: 61

Reply to This

Replies to This Discussion

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);

RSS

TTWT Magazine


Advertisement

Advertisement

Advertisement

Advertisement

¬© 2019   Created by Quality Testing.   Powered by

Badges  |  Report an Issue  |  Terms of Service