【发布时间】:2014-02-20 14:19:29
【问题描述】:
我正在尝试在 android 设备(不仅仅是 webview 或其他浏览器,而是 Chrome 浏览器)上自动化 android Chrome 浏览器。我认为通过此链接https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android 可以做到这一点,但它会自动执行我的 pc chrome 浏览器。
我也试过Appium,但是log之后什么都没有发生:
debug: executing: adb install C:\Users\hidden\Downloads\AppiumForWindows-0.14.2\
Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk
当我尝试从浏览器访问信息时,我得到了这个:
info: Responding to client with error: {"status":13,"value":{"message":"An unkno
wn server-side error occurred while processing the command.","origValue":"Did no
t successfully proxy server command"},"sessionId":"666c9e4f-7653-487a-b299-959d4
000ca79"}
我的环境变量 PATH 中确实有 chromedriver.exe,整个日志如下所示:
info: Welcome to Appium v0.14.2
info: Appium REST http interface listener started on 127.0.0.1:5555
info - socket.io started
debug: Appium request initiated at /wd/hub/session
debug: Request received with params: {"desiredCapabilities":{"platform":"ANDROID
","app":"chrome","browserName":"android","browserConnectionEnabled":true,"app-pa
ckage":"com.android.chrome","device":"android","rotatable":true,"app-activity":"
com.google.android.apps.chrome.Main","takesScreenshot":true,"version":""}}
info: Looks like we want chrome on android
info: Creating new appium session 666c9e4f-7653-487a-b299-959d4000ca79
info: Ensuring Chromedriver exists
debug: Pushing unlock helper app to device...
debug: executing: adb install C:\Users\hidden\Downloads\AppiumForWindows-0.14.2\
Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk
warn: killed=false, code=1, signal=null
debug: Appium request initiated at /wd/hub/status
debug: Request received with params: {}
debug: Proxying command to 127.0.0.1:9515
info: Making http request with opts: {"url":"http://127.0.0.1:9515/wd/hub/status
","method":"GET"}
info: Responding to client with error: {"status":13,"value":{"message":"An unkno
wn server-side error occurred while processing the command.","origValue":"Did no
t successfully proxy server command"},"sessionId":"666c9e4f-7653-487a-b299-959d4
000ca79"}
GET /wd/hub/status 500 1014ms - 238b
POST /wd/hub/session 200 31311ms
谢谢。
【问题讨论】:
-
你在安卓设备的开发者选项中开启USB调试了吗?
-
是的,我有。我可以很好地自动化 selendroid 浏览器。我认为使用 selenium 自动化 chrome 浏览器是不可能的。我最终只创建了一个带有 webview 的 4.4 项目,并使用检测工具将 chrome pc 工具连接到我的设备。
-
有趣,Chrome 浏览器当然可以自动化(我已经通过遥测完成了),但我还没有通过 Selenium 测试过
-
谢谢,我来看看遥测。
标签: android google-chrome selenium appium