-1

org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not accessible Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'

I am getting this error randomly i want to know the route cause for this issue in IOS

Ganesh
  • 11
  • 6

2 Answers2

0

There are multiple reason behind this issue. There are multiple ways to resolve this issues, depending upon, where these issues are coming from.

1)One issue which occur to me was DesireCapabilities.setCapability() key/value was not correct type. I have resolved this issue by just DesiredCapabilities.setCapability("capabilities_variable","capabilities_value"); setCapability("appWaitDuration", "600000"); here 600000 was String instead of long or int Check your setCapability type whether it String/int/long.

2) Check USB Connection is Laptop or Computer, if not connected than same issue.

3) ADB Server might be problem. So adb kill-server and adb start-server

4) Try to change USB and try it out.

5) Sometimes, it might be a proxy issue(Laptop/Desktop may have some proxy setup in organization, since for Desktop/Laptops are connected with Mobile via TCP/IP Connection).

6) Sometimes, there might be permission required to access PORT (sudo ufw allow portnumber (UBUNTU SYSTEM))

7) Environment variable required Android_SDK_Home and Android Platform Tools path

Ritesh Toppo
  • 323
  • 1
  • 4
  • 13
-1
**> Solution 1st**

DesiredCapabilities capabilities = new DesiredCapabilities();
capabilities.setCapability("deviceName", "xyz");
capabilities.setCapability("platformVersion", "6.0");
capabilities.setCapability("platformName", Platform.ANDROID);
capabilities.setCapability("appPackage", "com.hp.HPSupportAssistant");
capabilities.setCapability("appActivity", "com.hp.HPSupportAssistant.MainActivity");
 capabilities.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, 6000);    capabilities.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS,true);
//desiredCap.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);

**Here  comment below line and then run it will work** 
desiredCap.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);

**solution 2nd Or keep above line in desired capabilities but before that do
run 3 cmd on cmd promt**
adb shell pm list packages -f > D://t.txt
adb uninstall io.appium.uiautomator2.server
adb uninstall io.appium.uiautomator2.server

desiredCap.setCapability(MobileCapabilityType.AUTOMATION_NAME, AutomationName.ANDROID_UIAUTOMATOR2);
karishma
  • 26
  • 3