An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up

Build info: version: ‘4.13.0’, revision: ‘ba948ece5b*’

System info: os.name: ‘Mac OS X’, os.arch: ‘x86_64’, os.version: ‘14.2’, java.version: ‘17.0.7’

Driver info: io.appium.java_client.android.AndroidDriver

Command: [999f8cdd-1fcb-4e5b-ba33-64e19882d156, findElement {using=xpath, value=//*[@class=‘android.widget.TextView’ and contains(@text,‘Settings’)]}]

@Parameters({ "PlatformName", "AppPackageName", "AppActivityName", "DeviceName", "UID" })
public void DriverDeclaration(String PlatformName, String AppPackageName, String AppActivityName, String DeviceName, String UID) throws MalformedURLException, InterruptedException {

	DesiredCapabilities caps = new DesiredCapabilities();
	caps.setCapability("platformName", PlatformName);
	caps.setCapability("appPackage", AppPackageName);
	caps.setCapability("appActivity", AppActivityName);
	caps.setCapability("deviceName", DeviceName);
	caps.setCapability("automationName", "uiautomator2");
	caps.setCapability("uid", UID);
	caps.setCapability("nativeWebScreenshot", true);
	//caps.setCapability("autoLaunch", true);
	caps.setCapability("autoReset", true);
	caps.setCapability("noReset", false);
	caps.setCapability("gpsEnabled", true);
	driver = new AndroidDriver(new URL("http://127.0.0.1:9200/wd/hub"), caps);
	startTime = System.currentTimeMillis();
}

I am facing issue when i running a test multiple time it runs for arounf 5-6 times later it throws an error which i shared above.

i am iterating the test case for 10 times

I have 2 pieces of advice for you.

  1. This looks like Appium 1. Since this has been unsupported for almost 2 years now I would advise upgrading to Appium 2.
  1. I would run on an earlier version of Java. I’m seeing notes of odd behavior on Java 16+. Would recommend using Java 15 or below for easiest use.