'POST /element' cannot be proxied to UiAutomator2 server

See original GitHub issue

The 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:closed
  • Created 2 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mykola-mokhnachcommented, Aug 17, 2021

08-17 16:35:51.097 4594 4613 E tomator2.serve: failed to connect to jdwp control socket: Connection refused

My previous assumption was correct. restarting adb in root mode also resets all connections. Nothing we could do there from Appium side though

0reactions
mykola-mokhnachcommented, Aug 21, 2021

Closed as not an issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

'POST /elements' cannot be proxied to UiAutomator2 server ...
Original error: 'POST /elements' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed).
Read more >
An unknown server-side error occurred while processing the ...
An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to UiAutomator2.
Read more >
Appium - 'POST /element' cannot be proxied to UiAutomator2 ...
Original error: 'POST /element' cannot be proxied to UiAutomator2 server because the instrumentation process is not running (probably crashed).
Read more >
error:'*****' cannot be proxied to UiAutomator2 server because ...
This error may appear when acquiring a capture or running a test. First, try the following: Run the test again Relaunch device Delete......
Read more >
Appium: UnknownError: An unknown server-side error ...
This exception is usually thrown, when io.appium.uiautomator2.server application is killed on Android side. It's possible that system kills ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found