0

Selenium is unable to create the session.

  • Android version :- 7.1.1
  • Selenium version :-2.50.1
  • TestNG :-6.8
  • Appium -3.3.0 :-2.50.1

Appium is unable to even install the app in the Mobile device but the same code is working on the Motorola Device of the Android version 6.0. My chrome driver is also updated. Please help in solving the same.

Spring framework :-4.1.6.RELEASE

    Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'System info: host: 'Latitude-E5540', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-42-generic', java.version: '1.8.0_131'
   Driver info: driver.version: AndroidDriver
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:91)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:141)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:69)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:241)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:128)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:141)
at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:36)
at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:114)
at io.appium.java_client.A## Heading ##ppiumDriver.<init>(AppiumDriver.java:132)
at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:92)
at InstallApp.test(InstallApp.java:54)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:108)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:661)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:869)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1193)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:126)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:744)
at org.testng.TestRunner.run(TestRunner.java:602)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:380)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:375)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:340)
at org.testng.SuiteRunner.run(SuiteRunner.java:289)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1301)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1226)
at org.testng.TestNG.runSuites(TestNG.java:1144)
at org.testng.TestNG.run(TestNG.java:1115)
at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)

1 Answers1

0

The error does gives some hint about whats wrong happening :

Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'System info: host: 'Latitude-E5540', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-42-generic', java.version: '1.8.0_131'
Driver info: driver.version: AndroidDriver

The error clearly mentions that the AndroidDriver is not getting detected back as in :

Driver info: driver.version: AndroidDriver

Your main issue is the version compatibility between the binaries you are using as follows :

  • You are using AndroidDriver but the version and details are unknown to us.
  • Your Web Client version and details is unknown to us.
  • Your Selenium Client version is 3.0.1 of 2016-10-18 09:49:13 -0700 which is almost 1.5 years older.
  • Your JDK version is 1.8.0_131 which is pretty ancient.
  • Your TestNG version is 6.8 which is pretty old.

So there is a clear mismatch between the JDK v8u131 , Selenium Client v3.0.1 , AndroidDriver version, TestNG version and the Web Client version.

Solution

  • Upgrade JDK to recent levels JDK 8u162.
  • Upgrade Selenium to current levels Version 3.11.0.
  • Upgrade TestNG to current levels Version 6.14.2.
  • Upgrade AndroidDriver to current levels.
  • Upgrade Web Client to current levels.
  • Clean your Project Workspace through your IDE and Rebuild your project with required dependencies only.
  • Use CCleaner tool to wipe off all the OS chores before and after the execution of your test Suite.
  • If your base Web Client version is too old, then uninstall it through Revo Uninstaller and install a recent GA and released version of Web Client.
  • take a System Reboot.
  • Execute your @Test.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    How to know the android Driver version and the Web Client Version and how to update it ? I am trying it to run on the Redmi Note 5 pro and it is not working. Please help me in the same –  Apr 01 '18 at 15:11
  • @Nikhil_Coder _How to know the android Driver version and the Web Client Version_ should be part of your configuration/setup which I am not aware in _Redmi Note 5 pro_. – undetected Selenium Apr 01 '18 at 17:11