I am performing some appium automation on a native android app and I am stuck with the following situation:
I have a login button which has the following characteristics (see screenshot attached). Now no matter if the login button is enabled or disabled, those characteristic you see in the screenshot don't change. This is a problem as I want to test that the login button is disable based on certain text entry criterias.
I am unsure if something else is driving the login button where it is enabled or disabled (by the way whether the button is enabled or disabled, it visually looks the same).
Does anybody have any ideas on how I can tackle this? If I cannot do anything in regards to checking the button, the only thing I can think of (if it is possible) is to somehow determine after I click the login button that I remain on the same page (maybe wait for no retry message to be displayed as well as checking the login button remains on the page).
Thanks
Actually, Appium does support this kind of check: element/:element_id/enabled
MobileElement element = (MobileElement) driver.findElementByResourceId("login_submit");
boolean isEnabled = element.isEnabled();
If still always returns you the same result I suggest checking the source code of your app to make sure property is set properly. It is much better to fix the App for testability instead of the hacky check by clicking.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With