'POST /element' cannot be proxied to UiAutomator2 server
See original GitHub issueThe problem
When I run my tests, the JUnit failure trace shows the following error:
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed). Check the server log and/or the logcat output for more details
Environment
- Appium version (or git revision) that exhibits the issue: 1.20.2
- Desktop OS/version used to run Appium: Linux Mint 20 Cinnamon 4.6.7
- Node.js version (unless using Appium.app|exe): v10.19.0
- Npm or Yarn package manager: 7.20.0
- Mobile platform/version under test: Android 11 Emulator (Based on: Android API 30 Tag/ABI: google_apis/x86_64)
- Real device or emulator/simulator: Emulator
Details
It only happens (and always happens) the first time I run the tests after starting the Android emulator.
Link to Appium logs
Appium Logs: https://gist.github.com/VitorJeremias/fd99c330fb1a7b279fa3efb0117b862e Logcat output: https://gist.github.com/VitorJeremias/54807f1b27a01eb14f46ea802b7c709e
Code To Reproduce Issue [ Good To Have ]
The test simply instantiates the driver and forces a fail (AssertTrue(False)
). After it fails, I use TestWatcher to get some info from the error:
@Rule
public TestRule testeRule = new TestWatcher() {
@Override
protected void failed(Throwable exception, Description description) {
TestReportManager reportManager = new TestReportManager(driver);
reportManager.getAppLogFile(description);
};
@Override
protected void finished(Description description) {
closeCrashView(); // This closes any alerts that may eventually appear in the tests
quitDrivers();
}
};
Note: The getAppLogFile()
method runs the following commands:
export PATH=$PATH:/home/$USER/AndroidSDK/platform-tools ; adb -s emulator-5554 root
adb -s emulator-5554 pull /sdcard/Android/data/com.csg.securechat/files/logging/activity.log /home/vitor/Documents/AutomatedTests/Reports/activity.log
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (2 by maintainers)
Top GitHub Comments
My previous assumption was correct. restarting adb in root mode also resets all connections. Nothing we could do there from Appium side though
Closed as not an issue