UiAutomator died while responding to command
Recently while working on one of the Appium automation framework, we noticed this error:
"org.openqa.selenium.WebDriverException: UiAutomator died while responding to command,
please check appium logs! (WARNING: The server did not provide any stacktrace information)
Let me explain the framework we have. The framework is using Cucumber + Appium + Gradle. So the
test are written in feature file in plain english and in turn talk to step implementation which calls the page
class for any action. We also have some utils written which basically captures the screenshot of the device
on the step of failure and captures the adb log of the device. But in this case of error there was no snapshot
taken. Also we are running the tests in parallel and are not using Selenium grid, we have our own custom
solution to take care of it.
Couple of guess what we made:
- We suspected the issue to be session related and we tried the override session flag while starting appium server, but this didn’t fix it.
- We switched from Genymotion emulator to run the test on actual device and even that didn’t fix it.
- We changed the ADB from Genymotion to explicit machine installed one and even that didn’t solve it.
Lastly while seeing the execution carefully on both the device and almost after 3-4 runs, we found that when the network toggle test used to run the other device lost the connection or became un-reachable. I could see the device awake and the cursor blinking on the text box but device was in a state of wait till the new command time out happens and then it used to throw the error "UiAutomator died”.
So the actual culprit is the network toggle test running in parallel which caused it.