# Button attribute 'enabled' show false when set automationName to UiAutomator2

**URL:** <https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582>\
**Category:** Support\
**Created:** [August 21, 2019, 7:36am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582 "2019-08-21T07:36:34Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lily11](https://discuss.appium.io/user_avatar/discuss.appium.io/lily11/32/6002_2.png) [@Lily11](https://discuss.appium.io/u/Lily11)\
**Post date:** [August 21, 2019, 7:36am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/1 "2019-08-21T07:36:34Z")

</div>

In our app login page, the login button can be click when input username and password, like below screenshot:  
UIA2:

 ![image](https://discuss.appium.io/uploads/default/original/2X/6/646d4e07aa0d7954c733e1ecf0ff88df3b4413e0.png)  
UIA1:  
 ![image](https://discuss.appium.io/uploads/default/original/2X/d/d391d0231bf8125f3089d7c82bd32ab03d3ed63d.png)

what’s the difference between and UIA1 and UIA2

---

<div class="post-metadata">

**Author:** ![Lily11](https://discuss.appium.io/user_avatar/discuss.appium.io/lily11/32/6002_2.png) [@Lily11](https://discuss.appium.io/u/Lily11)\
**Post date:** [August 22, 2019, 2:03am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/2 "2019-08-22T02:03:05Z")

</div>

any one helps? give me some advices…

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [August 22, 2019, 8:54am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/3 "2019-08-22T08:54:18Z")

</div>

@Lily11 how you enter values (sendKey from keyboard or setValue)? implementation under different frameworks can slightly differ. And your app does not just get notified when field changed.

---

<div class="post-metadata">

**Author:** ![Lily11](https://discuss.appium.io/user_avatar/discuss.appium.io/lily11/32/6002_2.png) [@Lily11](https://discuss.appium.io/u/Lily11)\
**Post date:** [August 22, 2019, 9:12am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/4 "2019-08-22T09:12:25Z")

</div>

> [@Aleksei](#):
>
> implementation under different frameworks can slightly differ. And your app does not just get notified when field changed.

@Aleksei, I use RF + Appium, I use the keyword “input text” in AppiumLibrary.  
since appium get source will hang up sometimes when use UIA1, so I change to UIA2, unfortunately, can’t login now…

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [August 22, 2019, 10:29am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/5 "2019-08-22T10:29:28Z")

</div>

Try it in away:

1. tap on input
2. driver.getkeyboard.sendkeys(your text)

---

<div class="post-metadata">

**Author:** ![Lily11](https://discuss.appium.io/user_avatar/discuss.appium.io/lily11/32/6002_2.png) [@Lily11](https://discuss.appium.io/u/Lily11)\
**Post date:** [August 22, 2019, 10:44am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/6 "2019-08-22T10:44:44Z")

</div>

@Aleksei, Thanks your reply so soon! in AppiumLibrary, there are only ‘Input Text’ to input text, I try as below:

1. tap | &{locator\_email\_input}[${PLATFORM}]

2. Input Text | &{locator\_email\_input}[${PLATFORM}] ${email}

this not work also

---

<div class="post-metadata">

**Author:** ![Aleksei](https://discuss.appium.io/user_avatar/discuss.appium.io/aleksei/32/6267_2.png) [@Aleksei](https://discuss.appium.io/u/Aleksei)\
**Post date:** [August 22, 2019, 1:29pm UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/8 "2019-08-22T13:29:09Z")

</div>

@Lily11 it will not work. you need type from keyboard. in such case it will 100% work. otherwise you need ask Android dev to see changes when input changes with setValue.  
just for sure code in pure Appium client:

```auto
driver.getKeyboard().sendKeys("my_text");

```

---

<div class="post-metadata">

**Author:** ![Lily11](https://discuss.appium.io/user_avatar/discuss.appium.io/lily11/32/6002_2.png) [@Lily11](https://discuss.appium.io/u/Lily11)\
**Post date:** [August 23, 2019, 11:20am UTC](https://discuss.appium.io/t/button-attribute-enabled-show-false-when-set-automationname-to-uiautomator2/27582/9 "2019-08-23T11:20:23Z")

</div>

@Aleksei, thanks for your efforts, I input username and password which press the last chracter with android keycode, it works! I’m so existing! thanks very much!
