# UI tests failing on AVD every time

**URL:** <https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045>\
**Category:** Question & Answer\
**Tags:** step, android\
**Created:** [June 1, 2021, 12:45pm UTC](https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045 "2021-06-01T12:45:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vikramparimi](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@vikramparimi](https://discuss.bitrise.io/u/vikramparimi)\
**Post date:** [June 1, 2021, 12:45pm UTC](https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045/1 "2021-06-01T12:45:29Z")

</div>

Unable to pass the UI tests we have as part of our TestSuite. I am using a GradleRunner task to initiate the UI testing on the AVD, however all the fail with same error below:

`java.lang.RuntimeException: Waited for the root of the view hierarchy to have window focus and not request layout for 10 seconds. If you specified a non default root matcher, it may be picking a root that never takes focus. Root:`

Also, the same workflow works fine on my machine if I run it locally and all the test cases pass.

Any help would be appreciated to resolve this issue.

Gradle runner task

- gradle-runner@1:  
inputs:  
- gradlew\_path: “$PROJECT\_LOCATION/gradlew”  
- retry\_on\_failure: ‘no’  
- gradle\_options: ‘’  
- gradle\_task: “${MODULE}:connectedDebugAndroidTest ${SMOKE\_SUITE\_PACKAGE}”

Stack Info  
meta:  
[bitrise.io](http://bitrise.io):  
stack: linux-docker-android-20.04  
machine\_type\_id: standard

---

<div class="post-metadata">

**Author:** ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)\
**Post date:** [June 11, 2021, 11:46am UTC](https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045/2 "2021-06-11T11:46:36Z")

</div>

Hello @vikramparimi 👋

Can you please send us the log file or the URL of the related build and also enable Support Access on the `Settings` tab of the app ( [Enabling the Bitrise Support user for your app | Bitrise DevCenter](https://devcenter.bitrise.io/troubleshooting/enabling-bitrise-support-user/) ) so that we can take a more in-depth look? 🙂

---

<div class="post-metadata">

**Author:** ![vikramparimi](https://avatars.discourse-cdn.com/v4/letter/v/3e96dc/32.png) [@vikramparimi](https://discuss.bitrise.io/u/vikramparimi)\
**Post date:** [June 28, 2021, 5:24am UTC](https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045/3 "2021-06-28T05:24:26Z")

</div>

Here you go 🙂

Build - [https://app.bitrise.io/build/348de028c0d48692#?tab=log](https://app.bitrise.io/build/348de028c0d48692#?tab=log)  
Support User - Enabled

---

<div class="post-metadata">

**Author:** ![Roland-Bak](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/roland-bak/32/3480_2.png) [@Roland-Bak](https://discuss.bitrise.io/u/Roland-Bak)\
**Post date:** [June 29, 2021, 8:28am UTC](https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045/4 "2021-06-29T08:28:33Z")

</div>

Thank you @vikramparimi 🙂

I checked in with the developers and this seems to be connected to an issue with the step, which they are aware of and are working actively on solving. Currently the next step comes when the next stack update happens, so this should be handled soon! 🙂

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/bitrise/original/2X/d/d901cf2aad020f2dd11918afc89ec2089bb87b35.png) [@system](https://discuss.bitrise.io/u/system)\
**Post date:** [July 29, 2021, 8:29am UTC](https://discuss.bitrise.io/t/ui-tests-failing-on-avd-every-time/17045/5 "2021-07-29T08:29:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
