Original error: Unable to parse remote response

Launching tests on GRID I’m receiving this eror:

java.lang.AssertionError: Initialization Android driver Unable to create a new remote session. Please check the server log for more details. Original error: Unable to parse remote response:

My driver initialisation:

public static AndroidDriver initAndroidDriver() throws Exception {
try {
String apkLink = SettingsProvider.getPropertyValue(“front.android.apk.link”) +
“/” + SettingsProvider.getPropertyValue(“front.android.version”);
DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME, “Android”);
capabilities.setCapability(MobileCapabilityType.APP, apkLink);
capabilities.setCapability(MobileCapabilityType.FULL_RESET, true);
capabilities.setCapability(MobileCapabilityType.NO_RESET, false);
capabilities.setCapability("appium:androidInstallTimeout ", 100000);
return new AppiumBuilder().createAndroidApkDriver(new URL(getSeleniumMobileGridHost()), capabilities);
} catch (MalformedURLException e) {
throw new Exception("Creating ANDROID driver exception " + e.getMessage());
}

Appium runs on the server

I did a google search and found this:

Yeah I read this article, but unfortunately it didn’t helped

I went to the Selenium user group and searched for similar problem. They think it must be a proxy issue.

https://groups.google.com/g/selenium-users/c/3FQgw_R6K5c/m/kBwj3hkVBwAJ

Any suggestions how to fix this issue?

If it’s a proxy issue, try turning it off & see if things will work. If you can’t do that, try working with the proxy to see if you can open a port.

Sorry to be vague, I just don’t know what your environment is like. If you come back with more details maybe I can find a solution. I don’t even know what OS you are trying to run this on.

I don’t know how to turn proxy off, I’m running tests on android device with appium docker image using default proxy

I know you have to configure networking on a docker image, but I have no idea how to do that. Maybe that could be the problem?

I will ask devops if they can help me

I’ve made local build build with appium and grid3 and received same error, so it isn’t problem with network

Right. I don’t know what this means. You installed with NPM this time? Or are you still having Docker issues?

With npm as said in documentation, without docker

What does the stack trace look like?

java.lang.AssertionError: Initialization Android driver Unable to create a new remote session. Please check the server log for more details. Original error: Unable to parse remote response: <!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <link rel="stylesheet" type="text/css" href="/assets/displayhelpservlet.css" media="all"/>
  <link href="/assets/favicon.ico" rel="icon" type="image/x-icon" />
  <script src="/assets/jquery-3.1.1.min.js" type="text/javascript"></script>
  <script src="/assets/displayhelpservlet.js" type="text/javascript"></script>
  <script type="text/javascript">
    var json = Object.freeze('{"consoleLink": "\u002fgrid\u002fconsole","type": "Grid Hub","class": "org.openqa.grid.web.servlet.DisplayHelpHandler$DisplayHelpServletConfig","version": "3.141.59"}');
  </script>
</head>
<body>

<div id="content">
  <div id="help-heading">
    <h1><span id="logo"></span></h1>
    <h2>Selenium <span class="se-type"></span>&nbsp;v.<span class="se-version"></span></h2>
  </div>

  <div id="content-body">
    <p>
      Whoops! The URL specified routes to this help page.
    </p>
    <p>
      For more information about Selenium <span class="se-type"></span> please see the
      <a class="se-docs">docs</a> and/or visit the <a class="se-wiki">wiki</a>.
      <span id="console-item">
        Or perhaps you are looking for the Selenium <span class="se-type"></span> <a class="se-console">console</a>.
      </span>
    </p>
    <p>
      Happy Testing!
    </p>
  </div>

  <div>
    <footer id="help-footer">
      Selenium is made possible through the efforts of our open source community, contributions from
      these <a href="https://github.com/SeleniumHQ/selenium/blob/master/AUTHORS">people</a>, and our
      <a href="http://www.seleniumhq.org/sponsors/">sponsors</a>.
   </footer>
  </div>
 </div>

</body>
</html>
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:17:03'
System info: host: 'NBWS0082.local', ip: '192.168.1.138', os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '12.3', java.version: '11.0.14'
Driver info: driver.version: AndroidDriver

	at org.testng.Assert.fail(Assert.java:99)
	at structures.test.UIBaseTest.driverInitializationFailureAssertion(UIBaseTest.java:221)
	at structures.test.UIBaseTest.initializeAndroidDriver(UIBaseTest.java:178)
	at bet20.Bet20UiTest.startMobileAppAndroid(UiTest.java:40)
	at android.RegistrationTests.registrationTest(RegistrationTests.java:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:133)
	at org.testng.internal.TestInvoker.invokeMethod(TestInvoker.java:598)
	at org.testng.internal.TestInvoker.invokeTestMethod(TestInvoker.java:173)
	at org.testng.internal.MethodRunner.runInSequence(MethodRunner.java:46)
	at org.testng.internal.TestInvoker$MethodInvocationAgent.invoke(TestInvoker.java:824)
	at org.testng.internal.TestInvoker.invokeTestMethods(TestInvoker.java:146)
	at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:146)
	at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:128)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
	at org.testng.TestRunner.privateRun(TestRunner.java:794)
	at org.testng.TestRunner.run(TestRunner.java:596)
	at org.testng.SuiteRunner.runTest(SuiteRunner.java:377)
	at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:371)
	at org.testng.SuiteRunner.privateRun(SuiteRunner.java:332)
	at org.testng.SuiteRunner.run(SuiteRunner.java:276)
	at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:53)
	at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:96)
	at org.testng.TestNG.runSuitesSequentially(TestNG.java:1212)
	at org.testng.TestNG.runSuitesLocally(TestNG.java:1134)
	at org.testng.TestNG.runSuites(TestNG.java:1063)
	at org.testng.TestNG.run(TestNG.java:1031)
	at com.intellij.rt.testng.IDEARemoteTestNG.run(IDEARemoteTestNG.java:66)
	at com.intellij.rt.testng.RemoteTestNGStarter.main(RemoteTestNGStarter.java:109)

Could you post the server log? I think we are getting somewhere.

Found solution, someone changed link to grid in property file, added /wd/hub and everything started to work

1 Like

Awesome. Glad you were able to find it.

1 Like