3
**Environment** 
- java client build version : 6.1.0 
- Appium server version : 1.7.1 
- Desktop OS/version used to run Appium if necessary: Windows 7 
- Node.js version : 6.4.1 
- Mobile platform/version under test: Android/ 8.1.0 
- Real device or emulator/simulator: Real device 
- Selenium Version: 3.12.0
- TestNg Version : 6.14.3 

After set following below desired capabilities still unable to launch app, still getting an error on console "Exception in thread "main" 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" However unable to get appium server log because of getting this error appium server getting closed automatically : I have captured video for appium server log during execution Please find screencast for that: https://www.screencast.com/t/4f8j8cEveZ

 Code To Reproduce Issue [ Good To Have ] 
public class launchApp {
AndroidDriver<WebElement> driver;

@BeforeClass
public void beforeClass() throws MalformedURLException, InterruptedException {
    DesiredCapabilities capab = new DesiredCapabilities();

    capab.setCapability("deviceName", "Redmi Note 5");
    capab.setCapability("udid", "35924c6f0804");
    capab.setCapability("platformName", "Android");
    capab.setCapability("platformVersion", "8.1.0");
    capab.setCapability("appPackage", "com.miui.calculator");
    capab.setCapability("appActivity", "com.miui.calculator.cal.CalculatorActivity");
    driver = new AndroidDriver<WebElement>(new URL("http://0.0.0.0:4723/wd/hub"), capab);
   
     Thread.sleep(5000);
}

@Test
public void m1() throws InterruptedException {
    System.out.println("kfd");
    Thread.sleep(2000);
   
}
}




Ecxeption stacktraces 
Console Exception:
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.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: 'OFFICE-PC', ip: '---.---,---', 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:548)
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:212)
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)
at com.example.office.appium_project.launchApp.beforeClass(launchApp.java:38)
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:124)
at org.testng.internal.MethodInvocationHelper.invokeMethodConsideringTimeout(MethodInvocationHelper.java:59)
at org.testng.internal.Invoker.invokeConfigurationMethod(Invoker.java:458)
at org.testng.internal.Invoker.invokeConfigurations(Invoker.java:222)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:523)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648) 
surbhi gupta
  • 61
  • 1
  • 2
  • can u try with selenium version 2.53 once? – Amit Jain Oct 17 '18 at 11:48
  • You state at the start that your selenium is 3.12.0 but the error log indicates that it's 3.14.0. That's not necessarily your problem, but you should be aware. If I were to guess at this point (and it would be a guess) I'd try not using WebElement and instead using either MobileElement or AndroidElement, i.e. `AndroidDriver` – Bill Hileman Oct 17 '18 at 14:14
  • @Amit Jain #Bill Hileman I have updated WebElement to AndroidElement and also tried with all version of selenium jar but unable to launch app on mobile device. Kindly, suggest stable version of appium with selenium so that i can fix my problem. – surbhi gupta Oct 18 '18 at 08:34
  • Did you tried below dependency ? ` org.seleniumhq.selenium selenium-java 2.53.0 ` – Amit Jain Oct 18 '18 at 08:48
  • I have also tried with the selenium 2.53.0 but still getting same error unable to open app...Can you plz suggest stable version of Appium and selenium ? – surbhi gupta Oct 18 '18 at 11:48

0 Answers0