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 issueDescription
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] [35m[Appium][39m Welcome to Appium v1.9.0
[info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[info] [35m[HTTP][39m [37m–>[39m [37mPOST[39m [37m/wd/hub/session[39m
[info] [35m[HTTP][39m [90m{“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”:[{}]}}[39m
[debug] [35m[MJSONWP][39m 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] [35m[BaseDriver][39m Event ‘newSessionRequested’ logged at 1539025148940 (00:29:08 GMT+0530 (India Standard Time))
[warn] [35m[BaseDriver][39m The capabilities [“skipUnlock”] are not standard capabilities and should have an extension prefix
[warn] [35m[BaseDriver][39m Boolean capability passed in as string. Functionality may be compromised.
[warn] [35m[Appium][39m Consider setting ‘automationName’ capability to ‘UiAutomator2’ on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[info] [35m[Appium][39m Creating new AndroidDriver (v3.7.0) session
[info] [35m[Appium][39m Capabilities:
[info] [35m[Appium][39m platformName: android
[info] [35m[Appium][39m skipUnlock: true
[info] [35m[Appium][39m app: getAbsolutePath()
[info] [35m[Appium][39m deviceName: Redmi
[info] [35m[Appium][39m noReset: true
[info] [35m[Appium][39m platformVersion: 8.1.0
[debug] [35m[BaseDriver][39m W3C capabilities {“alwaysMatch”:{"platformNa… and MJSONWP desired capabilities {“app”:“getAbsolutePath()”,… were provided
[debug] [35m[BaseDriver][39m Creating session with W3C capabilities: {“alwaysMatch”:{"platformNa…
[warn] [35m[BaseDriver][39m Boolean capability passed in as string. Functionality may be compromised.
[warn] [35m[BaseDriver][39m Boolean capability passed in as string. Functionality may be compromised.
[warn] [35m[BaseDriver][39m Capability ‘noReset’ changed from string to boolean. This may cause unexpected behavior
[warn] [35m[BaseDriver][39m Capability ‘skipUnlock’ changed from string to boolean. This may cause unexpected behavior
[info] [35m[BaseDriver][39m Session created with session id: ffdbc25c-67eb-42bd-8496-18a1b179061d
[info] [35m[AndroidDriver][39m Java version is: 1.8.0_91
[info] [35m[AndroidDriver][39m Retrieving device list
[debug] [35m[ADB][39m Trying to find a connected android device
[debug] [35m[ADB][39m Getting connected devices…[debug] [35m[ADB][39m 1 device(s) connected
[info] [35m[AndroidDriver][39m Looking for a device with Android ‘8.1.0’
[debug] [35m[ADB][39m Setting device id to 35924c6f0804
[info] [35m[ADB][39m Getting device platform version
[debug] [35m[ADB][39m Running ‘C:\Users\Office\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.build.version.release’
[debug] [35m[ADB][39m Current device property ‘ro.build.version.release’: 8.1.0
[info] [35m[AndroidDriver][39m Using device: 35924c6f0804
[debug] [35m[ADB][39m Setting device id to 35924c6f0804
[debug] [35m[ADB][39m Running ‘C:\Users\Office\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 35924c6f0804 shell getprop ro.build.version.sdk’
[debug] [35m[ADB][39m Current device property ‘ro.build.version.sdk’: 27
[debug] [35m[ADB][39m Device API level: 27
[warn] [35m[AndroidDriver][39m Consider setting ‘automationName’ capability to ‘uiautomator2’ on Android >= 6, since UIAutomator framework is not maintained anymore by the OS vendor.
[debug] [35m[AndroidDriver][39m Shutting down Android driver
[debug] [35m[AndroidDriver][39m Called deleteSession but bootstrap wasn’t active
[debug] [35m[ADB][39m Running ‘C:\Users\Office\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s 35924c6f0804 shell am force-stop io.appium.unlock’[debug] [35m[AndroidDriver][39m Not cleaning generated files. Add clearSystemFiles
capability if wanted.
[debug] [35m[BaseDriver][39m Event ‘newSessionStarted’ logged at 1539025149562 (00:29:09 GMT+0530 (India Standard Time))
[error] [35m[W3C][39m Encountered internal error running command: Error: The application at ‘getAbsolutePath()’ does not exist or is not accessible
[error] [35m[W3C][39m 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] [35m[W3C][39m at tryCatch (C:\Users\Office\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[error] [35m[W3C][39m 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] [35m[W3C][39m 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] [35m[W3C][39m 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] [35m[W3C][39m at <anonymous>
[info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[31m500[39m [90m624 ms - 1587[39m
[info] [35m[HTTP][39m [90m[39m
Issue Analytics
- State:
- Created 5 years ago
- Comments:11 (3 by maintainers)
Top GitHub Comments
the error message is pretty clear
Try https://github.com/appium/java-client#how-to-install-latest-java-client-betasnapshots