appium / appium

Cross-platform automation framework for all kinds of apps, built on top of the W3C WebDriver protocol
http://appium.io/
Apache License 2.0
18.96k stars 6.08k forks source link

Appium creates a session which Selendroid doesn't identifiy #4130

Closed JennyGr closed 9 years ago

JennyGr commented 9 years ago

I'm trying to setup Selendroid with Appium app and Genymotion. The steps I follow are:

{
    status: 0,
    value: {
      supportedApps: [
        {
          appId: "io.selendroid.androiddriver:0.12.0",
          mainActivity: "io.selendroid.androiddriver.WebViewActivity",
          basePackage: "io.selendroid.androiddriver"
        }
      ],
      os: {
        arch: "x86_64",
        name: "Mac OS X",
        version: "10.9.5"
      },
      build: {
        browserName: "selendroid",
        version: "0.12.0"
      },
      supportedDevices: [
        {
          screenSize: "(1080, 1920)",
          platformVersion: "18",
          model: "Samsung Galaxy S4 - 4.3 - API 18 - 1080x1920",
          emulator: false,
          serial: "192.168.56.101:5555"
        }
      ]
    }
}
{
    status: 13,
    sessionId: "0714b95a-b31a-c19f-472b-5f6f9312a74e",
    value: {
        message: "Session was not found io.selendroid.exceptions.SelendroidException: Session was not found at io.selendroid.server.handler.GetCapabilities.handle(GetCapabilities.java:42) at 
        io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServlet.java:143) at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:67) at 
        io.selendroid.server.http.ServerHandler.channelRead(ServerHandler.java:53) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at 
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at 
        io.netty.handler.traffic.AbstractTrafficShapingHandler.channelRead(AbstractTrafficShapingHandler.java:223) at 
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at 
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at 
        io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103) at 
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at 
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at 
        io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:163) at 
        io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:148) at 
        io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:333) at 
        io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:319) at 
        io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:787) at 
        io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:125) at 
        io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511) at 
        io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468) at 
        io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382) at 
        io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354) at 
        io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:116) at 
        io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:137) at java.lang.Thread.run(Thread.java:745) ",
        class: "io.selendroid.exceptions.SelendroidException"
    }
}
info: <-- POST /wd/hub/session 303 12116.905 ms - 9 
info: --> GET /wd/hub/session/0714b95a-b31a-c19f-472b-5f6f9312a74e {}
info: [debug] Proxying command to localhost:4444
info: [debug] Making http request with opts: {"url":"http://localhost:4444/wd/hub/session/0714b95a-b31a-c19f-472b-5f6f9312a74e","method":"GET"}

info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Did not successfully proxy server command"},"sessionId":"0714b95a-b31a-c19f-472b-5f6f9312a74e"}
info: <-- GET /wd/hub/session/0714b95a-b31a-c19f-472b-5f6f9312a74e 500 5.344 ms - 210 

Q: Why selendroid is unable to identify the session?

sebv commented 9 years ago

You don't need to start the selendroid server, or specify the port.

JennyGr commented 9 years ago

When I don't start the selendroid server I still have the same issue:

info: [debug] Device launched! Ready for commands
info: [debug] Setting command timeout to 999999 secs
info: [debug] Appium session started with sessionId 92acfa11-8d42-c9c1-d70e-a90581ae8b44

info: <-- POST /wd/hub/session 303 11443.359 ms - 9 
info: --> GET /wd/hub/session/92acfa11-8d42-c9c1-d70e-a90581ae8b44 {}
info: [debug] Proxying command to localhost:4444
info: [debug] Making http request with opts: {"url":"http://localhost:4444/wd/hub/session/92acfa11-8d42-c9c1-d70e-a90581ae8b44","method":"GET"}
info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Did not successfully proxy server command"},"sessionId":"92acfa11-8d42-c9c1-d70e-a90581ae8b44"}
info: <-- GET /wd/hub/session/92acfa11-8d42-c9c1-d70e-a90581ae8b44 500 3.578 ms - 210 

info: --> GET /wd/hub/status {}

info: [debug] Proxying command to localhost:4444
info: [debug] Making http request with opts: {"url":"http://localhost:4444/wd/hub/status","method":"GET"}

info: [debug] Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"Did not successfully proxy server command"},"sessionId":"92acfa11-8d42-c9c1-d70e-a90581ae8b44"}
info: <-- GET /wd/hub/status 500 2.039 ms - 210 
sebv commented 9 years ago

Can you post full log in a gist?

JennyGr commented 9 years ago

Full log here: https://gist.github.com/JennyGr/59b48bfd725c9b6f5b65

JennyGr commented 9 years ago

Any update on this? Do you might need more symptoms?

sebv commented 9 years ago

I've moved it to next milestone, we need to try to reproduce.

JennyGr commented 9 years ago

Thanks for the update.

sebv commented 9 years ago

I've tried the same setup from master and it works fine for me.

Just one thing, you don't need to pass anything to the appium command line, just pass it in desired, it's cleaner.

JennyGr commented 9 years ago

I'm still able to reproduce the error. @sebv What kind of app are you using? When I use the selendroid-test-app.apk (http://mvnrepository.com/artifact/io.selendroid/selendroid-test-app/0.9.0) there's no issue with the selendroid server. The issue I'm reporting is reproducible with a hybrid titanium app.

sebv commented 9 years ago

Is there a public app I can test with?

JennyGr commented 9 years ago

Unfortunately, I cannot send you the app we are developing. I'll ask the devs to create a test app with which the issue is reproducible.

JennyGr commented 9 years ago

The issue is reproducible with the apk, that you can find it in this link: https://www.dropbox.com/s/iq4xrngeyrlk2ed/Test.apk?dl=0

To reproduce the issue use:

sebv commented 9 years ago

This is an issue with the wait activity, just add this cap:

desired.appWaitActivity = 'org.appcelerator.titanium.TiActivity';
JennyGr commented 9 years ago

This is the solution to start selendroid! Thank you! I have another issue now with appium inspector (for latest appium app 1.3.4), which doesn't present the elements hierarchy. But, I think we need a new ticket for that.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.