Hi,
How can I check if a widget or button on a mobile app is disabled or enabled? Thanks.
Hi,
How can I check if a widget or button on a mobile app is disabled or enabled? Thanks.
Try this This solution worked for me…
Here, expectedAttribute value you can pass enabled or disabled
@Keyword
verify_buttons_enabled_attribute_value(String expectedAttribute){
boolean enabledValue = isElementEnabled(testObject))
if(expectedAttribute.equalsIgnoreCase(“enabled”)){
Assert.assertTrue(enabledValue, buttonText +" button is not " + expectedAttribute)
}
if(expectedAttribute.equalsIgnoreCase(“disabled”)){
Assert.assertFalse(enabledValue, buttonText +" button is not " + expectedAttribute)
}
}
@Keyoword
boolean isElementEnabled(TestObject testObject) {
mobileElement = findMobileElement(testObject)
mobileElement.isEnabled()
}