SeleniumHQ / selenium-google-code-issue-archive

Archive, please see main selenium repo
https://github.com/seleniumhq/selenium
345 stars 195 forks source link

AndroidDriver server 2.32.0 APK does not work correctly with the Selenium Grid2 #5655

Closed lukeis closed 8 years ago

lukeis commented 8 years ago

Originally reported on Google Code with ID 5655

Installing the latest 2.32.0 apk to the emulator and then doing all the correct port
forwarding and socat port listening I am able to connect remotely and run tests if
I'm pointing at "hostIP:8081" but when I point it to the Grid2 "hub:4444" I get the
following error message: 

"org.openqa.selenium.WebDriverException: Error forwarding the new session Error forwarding
the request no protocol:"

I used Flynnid and a range of other method to successfully register the node on the
Grid hub but the test couldn't run because of the error.

I did a search and it seems that other had the same problem:

https://groups.google.com/forum/?fromgroups=#!searchin/selenium-users/android-server-2.32.0$20Error$20forwarding$20the$20request$20no$20protocol/selenium-users/JSUOaqwBpf4/rviWAKSRMBwJ

I then installed the android driver server 2.21.0 apk and I didn't get the error and
test runs as normal..

Reported by alan.to on 2013-05-15 10:17:39

lukeis commented 8 years ago

Reported by barancev on 2013-05-15 19:08:28

lukeis commented 8 years ago
I can confirm this is an issue only in the new APK and current build.  Connecting directly
to the Android host hub works fine, but doing so through the grid hub results in this
error. 

The error is throw on line 111 of RequestHandler.java in grid servlet.  See this gist
for full stack trace: https://gist.github.com/anonymous/5766761

After registering the hub successfully, POSTing to the grid hub's /wd/hub/session endpoint
returns the error - however the session IS created, as I can inspect it on the Android
hub's /wd/hub/static/resource/hub.html page, and command it to attempt to load google
or similar which results in the device navigating to the page.

Reported by wns.nick.williams on 2013-06-12 16:28:04

lukeis commented 8 years ago
I see the same issue. Trace it back, this issue happens from git commit 

[0]$ git log -n 1 0aa851cb85aba901d666ad01130d3e82c449e50d
commit 0aa851cb85aba901d666ad01130d3e82c449e50d
Author: Simon M Stewart <simon.m.stewart@gmail.com>
Date:   Fri Jun 8 13:25:11 2012 +0000

    SimonStewart: Moving the android APK from jetty to webbit. Tested on the x86 ICS
emulator, with the same level of failures as seen with jetty.

    r17142

Reported by allanzp on 2013-06-28 01:47:06

lukeis commented 8 years ago
Any update on this issue? Has anyone got around this issue?

Reported by ppotaraju on 2013-07-10 17:44:56

lukeis commented 8 years ago
I tried using the 2.21 version of the apk, but when i follow the steps listed at http://code.google.com/p/selenium/wiki/AndroidDriver,
http://localhost:8080/wd/hub gives me a 404 page not found.

Reported by ppotaraju on 2013-07-10 17:46:51

lukeis commented 8 years ago
Same issue for me. 

I used my custom powershell script to register the Android node to the grid (you can
find it at : https://gist.github.com/Juju31/5849600). 

It works fine with the 2.21 version of the apk, but the 2.32 version displays a white
screen when I launch a test with the Selenium grid and I get the same error : "Error
forwarding the new session".

Reported by julien.giffard on 2013-07-24 15:13:06

lukeis commented 8 years ago
Try http://localhost:8080/wd/hub in Firefox instead of chrome.

Or, ignore it and try your code.

Reported by allanzp on 2013-07-25 22:27:58

lukeis commented 8 years ago
I've hit this issue as well.  Is there an ETA on a fix?  

I tried using version 2.21 of the apk, but that's not working either.  On version 2.21
/wd/hub/status returns 302, only /wd/hub/status/ gives a 200 response.  Since the only
acceptable responses in the current version of the Selenium server are 200 and 404
the node cannot be registered.

Reported by billy@redbeacon.com on 2013-09-25 21:01:49

lukeis commented 8 years ago
I am using 4.2.2 Samsung Galaxy Tab 2 and latest pre built
androidserver.apk getting the following error while requesting Open browser

Logcat:

D/STATUSBAR-NetworkController(  647): refreshSignalCluster: data=0 bt=false
I/DefaultDriverFactory( 4399): Creating a new session for Capabilities
[{platform=ANDROID, acceptSslCerts=true, javascri
ptEnabled=true, browserName=android, browserConnectionEnabled=true,
rotatable=true, takesScreenshot=true, version=4.2.2}
]
E/webview ( 4399): Error: WebView.destroy() called while still attached!
D/webviewglue( 4399): nativeDestroy view: 0x6164c6a8
I/webclipboard( 4399): clipservice:
android.sec.clipboard.ClipboardExManager@422c1b00
V/webkit  ( 4399): BrowserFrame constructor: this=Handler
(android.webkit.BrowserFrame) {4289eca8}
D/WebView ( 4399): onSizeChanged - w:1280 h:702

Selenium logs: Selenium2LibraryFatalException:
org.openqa.selenium.WebDriverException: Error forwarding the new session
Error forwarding the request no protocol:
/wd/hub/session/fad54f61-9884-4926-ba16-a2d63aa3c511

Reported by mbdiwakar on 2013-09-25 23:02:40

lukeis commented 8 years ago
I was able to workaround a solution with following combination, can run
selenium tests on  device Galaxy Tab2(4.2.2) and Galaxy S3(4.1.1)

selenium-server-standalone-2.31.0.jar ( does not work with 2.33 or 2.35)
Android server APK 2.21.0

JSON to register nodes: config.json

{
    "hub": {
        "host": "selenium-host.com",
        "port": 4444
    },
    "nodes": [{
        "host": "selenium-node.com",
        "port": 6666,
        "browser": {
            "name": "android",
            "version": "4.2.2"
        },
        "platform": "ANDROID"
    },{
        "host": "selenium-node",
        "port": 5555,
        "browser": {
            "name": "android",
            "version": "4.1.1"
        },
        "platform": "ANDROID"
    }]
}

#setup port forwarding on selenium-node

# start hub  on selenium-hum

#  register node to grid from selenium-node
flynnid  config.json

Reported by mbdiwakar on 2013-09-26 23:54:13

lukeis commented 8 years ago
Any news on this? Running into this issue too and need to test using multiple emulator
instances. Here's my setup:

- Windows 7 VM running three Android Emulators
- WebDriver android-server-2.32.0.apk
- Selenium Grid on CentOS
- Android emulators connected to grid using FlynnID script
- Different other Selenium-Nodes too

Tested this with latest Vaadin TestBench too but got the same result.
Any help would be much appreciated! Thx a lot in advance.

Reported by starwarsfanluke on 2013-10-04 13:24:12

lukeis commented 8 years ago
Selenium project no longer supports the AndroidDriver.

Please use Selendroid instead:
http://selendroid.io/webview.html

And log any issues against that project:
https://github.com/selendroid/selendroid/issues

Reported by luke.semerau on 2013-12-26 21:57:36

lukeis commented 8 years ago

Reported by luke.semerau on 2015-09-17 18:17:15