无法在真实设备上执行Appium脚本

时间:2014-12-08 18:37:35

标签: android selenium mobile automation appium

到目前为止我做了什么:

  1. 安装Appium服务器并启动它。
  2. 下载了Android SDK并创建了虚拟设备(在我的情况下克隆了Nexus 5)
  3. 在Emulator上创建执行的Java脚本(默认浏览器:“浏览器” - 脚本执行成功
  4. 连接的真实联系 - >它有chrome作为本机浏览器
  5. 在脚本和更新的浏览器中将设备名称更新为“Chrome”已执行脚本 - >浏览器打开 - >
  6. 的问题:

      
        
    1. 它总是提示我接受Chrome的谷歌条款和条件,然后要我登录。当我手动尝试 - 它没有   提示相同...任何解决方案/解决方法摆脱它?

    2.   
    3. 一旦我手动接受条款和条件并登录 - >浏览器只显示数据:;并且没有得到重定向:错误显示:   无法创建新会话。 (原始错误:未从Chromedriver获取会话重定向)(警告:服务器没有   提供任何堆栈跟踪信息)命令持续时间或超时:68.98   秒构建信息:版本:'2.44.0',修订版:   '76d78cf323ce037c5f92db6c1bba601c2ac43ad8',时间:'2014-10-23   13:11:40'系统信息:主持人:'ABT-JS-H03104.local',ip:'X.X.X.X',   os.name:'Mac OS X',os.arch:'x86_64',os.version:'10 .9.5',   java.version:'1.7.0_71'驱动程序信息:   io.appium.java_client.AppiumDriver

    4.   
    **Server log:** 
    *debug] [CHROMEDRIVER] Starting ChromeDriver (v2.10.267517) on port 9515 Only local connections are allowed. info: [debug] Making http request with opts: {"url":"http: //127-0-0-1:9515/wd/hub/session","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"<devicename>"}}}} info: [debug] Could not connect yet; retrying info: [debug] Making http request with opts: {"url":"http: //127-0-0-1:9515/wd/hub/session","method":"POST","json":{"sessionId":null,"desiredCapabilities":{"chromeOptions":{"androidPackage":"com.android.chrome","androidDeviceSerial":"<DeviceName>"}}}} error: Chromedriver create session did not work. Status was 200 and body was {"sessionId":"a925aadb8215cdb1b5b31e4d17562398","status":100,"value":{"message":"chrome not reachable\n  (Driver info: chromedriver=2.10.267517,platform=Mac OS X 10.9.5 x86_64)"}} info: [debug] Cleaning up appium session error: Failed to start an Appium session, err was: Error: Did not get session redirect from Chromedriver info: [debug] Error: Did not get session redirect from Chromedriver
        at null.<anonymous> (/usr/local/lib/node_modules/appium/lib/devices/android/chromedriver.js:222:12)
        at Request._callback (/usr/local/lib/node_modules/appium/lib/devices/common.js:121:5)
        at Request.self.callback (/usr/local/lib/node_modules/appium/node_modules/request/request.js:121:22)
        at Request.emit (events.js:98:17)
        at Request.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/request/request.js:985:14)
        at Request.emit (events.js:117:20)
        at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/appium/node_modules/request/request.js:936:12)
        at IncomingMessage.emit (events.js:117:20)
        at _stream_readable.js:943:16
        at process._tickDomainCallback (node.js:463:13) info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Did not get session redirect from Chromedriver)","origValue":"Did not get session redirect from Chromedriver"},"sessionId":null}*
    

    我尝试过这样的事: 我尝试在我的本地appium文件夹中更新不同版本的chrome驱动程序

    任何帮助或方向??

1 个答案:

答案 0 :(得分:0)

您的手机上有哪个版本的Chrome?在我更新浏览器之前,我遇到了这个问题。 Chromedriver需要最低版本的Chrome 30。 https://sites.google.com/a/chromium.org/chromedriver/getting-started/getting-started---android