1

I'm Working in appium. previously, my code doesn't work in above 5.o WheN I changed its working fine. android version. driver = new AndroidDriver(new URL("http://192.168.1.2:4723/wd/hub"), capabilities); above code works fine in above 5.0 android version. And the app was launch and couldn't open the app and still got the same error.

Android setup

public class AndroidSetup {

    protected AndroidDriver driver;

    protected void prepareAndroidForAppium() throws MalformedURLException {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities.setCapability("appium-version", "1.6.3");
        capabilities.setCapability("platformName", "Android");
        capabilities.setCapability("platformVersion", "6.0");
        capabilities.setCapability("deviceName", "Mi Phone");
        capabilities.setCapability("app", "/home/naveen/IdeaProjects/QberLoginPage/app/Qber_Customer_V1.6.0.apk");
        capabilities.setCapability("appPackage", "com.ionicframework");
        capabilities.setCapability("appActivity", "");
        driver = new AndroidDriver(new URL("http://192.168.1.2:4723/wd/hub"), capabilities);
    }
}

Logintest

public class Logintest extends AndroidSetup {

    @BeforeClass
    public void setUp() throws Exception {
        prepareAndroidForAppium();
    }

    @AfterClass   
    public void tearDown() throws Exception {
        driver.quit();
    }

@Test
    public void login(){

    new Login(driver).invalidLogin();
}
}

loginpage

public class Login extends BasePage {

    public Login(WebDriver driver) {
        super(driver);
    }

    public Login invalidLogin() {

        return new Login(driver);
    }
}

Error:

Mar 21, 2017 2:02:10 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Attempting bi-dialect session, assuming Postel's Law holds true on the remote end
Mar 21, 2017 2:02:35 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to original OSS JSON Wire Protocol.
Mar 21, 2017 2:02:52 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Falling back to straight W3C remote end connection

org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=/home/naveen/IdeaProjects/QberLoginPage/app/Qber_Customer_V1.6.0.apk, appPackage=com.ionicframework.qber653346, appActivity=Main Activity, appium-version=1.6.3, platformVersion=6.0, platformName=Android, deviceName=Mi Phone}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'naveen-Inspiron-3542', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.0-66-generic', java.version: '1.8.0_121'
Driver info: driver.version: AndroidDriver
  • After fail 1000 times and 3 weeks of time finally I made it, it is all happen run jenkins and appium server in local machine. Thanks a ton – Ganesh Ram Aug 20 '17 at 20:13
0

Seems like session between client and server is failing to get initiated. I noticed that URL you use for Appium server is "http://0.0.0.0:4723/wd/hub". This could be an issue, since as I understood you are running Appium on the same machine where your client scripts reside, try using "http://localhost:4723/wd/hub" instead. Or use your local host ip address "http://127.0.1.1:4723/wd/hub".

In general make sure that your Appium server is started and running. You can do this by visiting URL in browser localhost:4723/wd/hub/status. You will be able to connect to URL and see something like this:{"status":0,"value":{"build":{"version":"1.5.3","revision":null}},"sessionId":null}

PS. It strange though if you are able to initiate session with the same settings for KitKat devices. I would expect it to fail for all devices since it couldn't pass desired capabilities to server to initiate automation session.

  • THis question is resolved because appActivity name there is a space between the words. – user24314 Mar 21 '17 at 11:54
0

hello guys I am facing the same kind of issue , I am unable to create the session with my real device my Appium server starts but after some time it freezes and it throws an exception org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c "java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar" C:\Software\selendroid-test-app-0.17.0.apk --override" java.util.zip.ZipException: zip file is empty

Environment 1) eclipse 2) appium 1.4.16.1 3) window 7 4) selenium web driver

Error discription

org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: Command failed: C:\Windows\system32\cmd.exe /s /c "java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\sign.jar" C:\Software\selendroid-test-app-0.17.0.apk --override" java.util.zip.ZipException: zip file is empty at java.base/java.util.zip.ZipFile$Source.zerror(Unknown Source) at java.base/java.util.zip.ZipFile$Source.findEND(Unknown Source) at java.base/java.util.zip.ZipFile$Source.initCEN(Unknown Source) at java.base/java.util.zip.ZipFile$Source.(Unknown Source) at java.base/java.util.zip.ZipFile$Source.get(Unknown Source) at java.base/java.util.zip.ZipFile.(Unknown Source) at java.base/java.util.zip.ZipFile.(Unknown Source) at java.base/java.util.jar.JarFile.(Unknown Source) at java.base/java.util.jar.JarFile.(Unknown Source) at java.base/java.util.jar.JarFile.(Unknown Source) at s.Sign.sign(Sign.java:441) at s.Sign.main(Sign.java:532) ) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 178.41 seconds Build info: version: '3.8.1', revision: '6e95a6684b', time: '2017-12-01T19:05:14.666Z' System info: host: 'MACPK-WKS-0066', ip: '192.168.8.27', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_161' Driver info: driver.version: AndroidDriver at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source) at java.lang.reflect.Constructor.newInstance(Unknown Source) at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214) at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53) at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91) at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:123) at java.util.stream.ReferencePipeline$3$1.accept(Unknown Source) at java.util.Spliterators$ArraySpliterator.tryAdvance(Unknown Source) at java.util.stream.ReferencePipeline.forEachWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyIntoWithCancel(Unknown Source) at java.util.stream.AbstractPipeline.copyInto(Unknown Source) at java.util.stream.AbstractPipeline.wrapAndCopyInto(Unknown Source) at java.util.stream.FindOps$FindOp.evaluateSequential(Unknown Source) at java.util.stream.AbstractPipeline.evaluate(Unknown Source) at java.util.stream.ReferencePipeline.findFirst(Unknown Source) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:126) at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:73) at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142) at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:129) at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:601) 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:219) at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:142) at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:84) at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94) at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:77) at com.macrosoft.CherryPick.selendroidTest.test1(selendroidTest.java:67) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47) at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17) at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268) at org.junit.runners.ParentRunner.run(ParentRunner.java:363) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:538) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:760) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:206)

  • If the accepted answer does not help you, please create a new question. – Kate Paulk Mar 2 '18 at 13:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy