question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

Description

When running Appium scrip then getting an error :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

Environment

  • java client build version : java-client-6.1.0
  • Appium server version : 1.9.0
  • Desktop OS/version used to run Appium if necessary: Windows 7
  • Mobile platform/version under test: Android/ 8.1.0
  • Real device or emulator/simulator: Real Device *Selenium version: 3.14.0

Details

Please help me to resolve this issue… i am stuck unable to proceed my coding…

Code To Reproduce Issue [ Good To Have ]

public class FistTest { public WebDriver driver; DesiredCapabilities capabilities=new DesiredCapabilities(); @BeforeMethod public void setup(){

    File app=new File("C://Eclipse_Setup//apk_file//Amazon.apk");
    capabilities.setCapability("deviceName","Redmi");
    capabilities.setCapability("platformVersion","8.1.0");
    capabilities.setCapability("platformName","Android");
    capabilities.setCapability("noReset","true");
    capabilities.setCapability("skipUnlock","true");
    capabilities.setCapability("app","getAbsolutePath()");

}

@Test
public void testApp()  {
    try {
        driver=new AndroidDriver(new URL("http://0.0.0.0:4723/wd/hub"),capabilities);

    } catch (Exception e) {
        e.printStackTrace();
    }
}
@AfterMethod
public  void quit(){
    driver.quit();
    driver.close();
}

Ecxeption stacktraces

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’ System info: host: ‘OFFICE-PC’, ip: ‘192.168.100.3’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_152-release’ Driver info: driver.version: AndroidDriver at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumCommandExecutor.java:195) at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCommandExecutor.java:209) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543) at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42) 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:207) at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130) at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84) at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94) at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:93)

Link to Appium logs

[info] [Appium] Welcome to Appium v1.9.0 [info] [Appium] Appium REST http interface listener started on 0.0.0.0:4723[info] [HTTP] –> POST /wd/hub/session [info] [HTTP] {“desiredCapabilities”:{“app”:“getAbsolutePath()”,“noReset”:“true”,“platformVersion”:“8.1.0”,“skipUnlock”:“true”,“platformName”:“Android”,“deviceName”:“Redmi”},“capabilities”:{“alwaysMatch”:{“appium:app”:“getAbsolutePath()”,“appium:deviceName”:“Redmi”,“appium:noReset”:“true”,“platformName”:“android”,“appium:platformVersion”:“8.1.0”,“skipUnlock”:“true”},“firstMatch”:[{}]}} [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:“getAbsolutePath()”,“noReset”:“true”,“platformVersion”:“8.1.0”,“skipUnlock”:“true”,“platformName”:“Android”,“deviceName”:“Redmi”},null,{“alwaysMatch”:{“appium:app”:“getAbsolutePath()”,“appium:deviceName”:“Redmi”,“appium:noReset”:“true”,“platformName”:“android”,“appium:platformVersion”:“8.1.0”,“skipUnlock”:“true”},“firstMatch”:[{}]}] [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1539025148940 (00:29:08 GMT+0530 (India Standard Time)) [warn] [BaseDriver] The capabilities [“skipUnlock”] are not standard capabilities and should have an extension prefix [warn] [BaseDriver] Boolean capability passed in as string. Functionality may be compromised. [warn] [Appium] Consider setting ‘automationName’ capability to ‘UiAutomator2’ on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor. [info] [Appium] Creating new AndroidDriver (v3.7.0) session [info] [Appium] Capabilities: [info] [Appium] platformName: android [info] [Appium] skipUnlock: true [info] [Appium] app: getAbsolutePath() [info] [Appium] deviceName: Redmi [info] [Appium] noReset: true [info] [Appium] platformVersion: 8.1.0 [debug] [BaseDriver] W3C capabilities {“alwaysMatch”:{"platformNa… and MJSONWP desired capabilities {“app”:“getAbsolutePath()”,… were provided [debug] [BaseDriver] Creating session with W3C capabilities: {“alwaysMatch”:{"platformNa… [warn] [BaseDriver] Boolean capability passed in as string. Functionality may be compromised. [warn] [BaseDriver] Boolean capability passed in as string. Functionality may be compromised. [warn] [BaseDriver] Capability ‘noReset’ changed from string to boolean. This may cause unexpected behavior [warn] [BaseDriver] Capability ‘skipUnlock’ changed from string to boolean. This may cause unexpected behavior [info] [BaseDriver] Session created with session id: ffdbc25c-67eb-42bd-8496-18a1b179061d [info] [AndroidDriver] Java version is: 1.8.0_91 [info] [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices…[debug] [ADB] 1 device(s) connected [info] [AndroidDriver] Looking for a device with Android ‘8.1.0’ [debug] [ADB] Setting device id to 35924c6f0804 [info] [ADB] Getting device platform version [debug] [ADB] Running ‘C:\Users\Office\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.build.version.release’ [debug] [ADB] Current device property ‘ro.build.version.release’: 8.1.0 [info] [AndroidDriver] Using device: 35924c6f0804 [debug] [ADB] Setting device id to 35924c6f0804 [debug] [ADB] Running ‘C:\Users\Office\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.build.version.sdk’ [debug] [ADB] Current device property ‘ro.build.version.sdk’: 27 [debug] [ADB] Device API level: 27 [warn] [AndroidDriver] Consider setting ‘automationName’ capability to ‘uiautomator2’ on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor. [debug] [AndroidDriver] Shutting down Android driver [debug] [AndroidDriver] Called deleteSession but bootstrap wasn’t active [debug] [ADB] Running ‘C:\Users\Office\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 35924c6f0804 shell am force-stop io.appium.unlock’[debug] [AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted. [debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1539025149562 (00:29:09 GMT+0530 (India Standard Time)) [error] [W3C] Encountered internal error running command: Error: The application at ‘getAbsolutePath()’ does not exist or is not accessible [error] [W3C] at Object.configureApp$ (C:\Users\Office\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\basedriver\helpers.js:97:11) [error] [W3C] at tryCatch (C:\Users\Office\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40) [error] [W3C] at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\Office\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22) [error] [W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (C:\Users\Office\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js💯21) [error] [W3C] at GeneratorFunctionPrototype.invoke (C:\Users\Office\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37) [error] [W3C] at <anonymous> [info] [HTTP] <-- POST /wd/hub/session 500 624 ms - 1587 [info] [HTTP] 

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

8reactions
mykola-mokhnachcommented, Oct 8, 2018

[error] �[35m[AndroidDriver]�[39m Error: The desired capabilities must include either an app, appPackage or browserName

the error message is pretty clear

Read more comments on GitHub >

github_iconTop Results From Across the Web

impossible to create a new session because 'createSession ...
If there is already an Appium server is running in the same IP and in the same port, this error message will be...
Read more >
It is impossible to create a new session because ...
It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it is not...
Read more >
WebDriverException: It is impossible to create a new session ...
WebDriverException : It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it...
Read more >
appium/appium - Gitter
WebDriverException : It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not found or it...
Read more >
ios it is impossible to create a new session because ...
org.openqa.selenium.WebDriverException: It is impossible to create a new session because 'createSession' which takes HttpClient, InputStream and long was not ...
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