• 我也想知道怎么同时控制两台设备,求高人指点

  • 我也是新手,用的 uiautonator,里面的 id 也会报错,同请教

  • @young 全部按要求配置完成,运行 android_contact.py 报如下错误,请大侠帮忙看看?谢谢!
    C:\Users\cylboy>python D:\test\android_contact.py
    Traceback (most recent call last):
    File "D:\test\android_contact.py", line 17, in
    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
    File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
    ine 72, in init
    self.start_session(desired_capabilities, browser_profile)
    File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
    ine 115, in start_session
    'desiredCapabilities': desired_capabilities,
    File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
    ine 164, in execute
    response = self.command_executor.execute(driver_command, params)
    File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connectio
    n.py", line 347, in execute
    return self._request(command_info[0], url, body=data)
    File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connectio
    n.py", line 429, in _request
    body = data.decode('utf-8').replace('\x00', '').strip()
    File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
    UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 193: invalid
    start byte

  • appium 安装不了的看这里 at 2014年04月08日

    @mingyuwang 谢谢这位朋友,已经解决,确实是环境变量没有配置。

  • python android_contact.py 的代码如下:
    import os
    from selenium import webdriver
    PATH = lambda p: os.path.abspath(
    os.path.join(os.path.dirname(file), p)
    )

    desired_caps = {}
    desired_caps['device'] = 'android'#android selendroid
    desired_caps['browserName'] = ''
    desired_caps['version'] = '4.1.2'
    desired_caps['app'] = PATH('D:\test\ContactManager.apk')
    desired_caps['app-package'] = 'com.example.android.contactmanager'
    desired_caps['app-activity'] = '.ContactManager'
    driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

    el = driver.find_element_by_name("Add Contact")
    el.click()

    textfields = driver.find_elements_by_tag_name("textfield")
    textfields[0].send_keys("My Name")
    textfields[2].send_keys("someone@somewhere.com")

    driver.find_element_by_name("Save").click()
    driver.quit()

  • @young 最后一步运行 CMD,进入 python 目录,输入命令 python android_contact.py 此时会自动安装 apk 并完成相应的添加联系人的操作
    我提示报错,请大侠帮忙看看是为何?
    C:\Python27\Scripts>python C:\Python27\Scripts\android_contact.py Traceback (most recent call last): File "C:\Python27\Scripts\android_contact.py", line 17, in driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 72, in init self.start_session(desired_capabilities, browser_profile) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 115, in start_session 'desiredCapabilities': desired_capabilities, File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 164, in execute response = self.command_executor.execute(driver_command, params) File "C:\Python27\lib\site-packages\selenium\webdriver\remote\remote_connection.py", line 347, in execute return self._request(command_info[0], url, body=data) File "C:\Python27\lib\site packages\selenium\webdriver\remote\remote_connection.py", line 429, in _request body = data.decode('utf-8').replace('\x00', '').strip() File "C:\Python27\lib\encodings\utf_8.py", line 16, in decode return codecs.utf_8_decode(input, errors, True) UnicodeDecodeError: 'utf8' codec can't decode byte 0xb4 in position 193: invalid start byte

  • @lihuazhang 目录结构:D:\test\appium-0.17.6 里面就是源码文件了。
    我采用http://testerhome.com/topics/657 帖子中的方法 appium 安装成功了 ,但是输入 appium-doctor,
    提示 C:\Users\cylboy>appium-doctor'appium-doctor' 不是内部或外部命令,也不是可运行的程序或批处理文件。
    请大侠看看是啥原因?感谢!

  • appium 安装不了的看这里 at 2014年04月04日

    太感谢了,用楼主提供的方法在 windows 下 appium 安装成功。但是输入 appium-doctor,提示
    C:\Users\cylboy>appium-doctor'appium-doctor' 不是内部或外部命令,也不是可运行的程序或批处理文件。
    请大侠看看是啥原因?感谢!

  • @lihuazhang step 2. appium-0.17.6 就是下载下来的源码,解压到目录 appium-0.17.6,然后在 cmd 分别运行以下两个命令:
    npm config set registry=http://registry.npmjs.org
    npm install -g appium-0.17.6
    截图就是运行命令后的报错呢

  • @lihuazhang 下载了也解压了,但是感觉 npm 还是到网上去找 Appium,请教下大侠是为何?

  • #3 楼 @xiaomayi0323 按照你提供的命令更新,提示 josn 解析出错,请教是什么原因?
    npm http 200 http://registry.npmjs.org/swig/-/swig-1.1.0.tgz
    npm http 200 http://registry.npmjs.org/express
    npm http GET http://registry.npmjs.org/express/-/express-3.4.8.tgz
    npm http 200 http://registry.npmjs.org/express/-/express-3.4.8.tgz
    npm http 200 http://registry.npmjs.org/async
    npm http GET http://registry.npmjs.org/async/-/async-0.2.10.tgz
    npm http 200 http://registry.npmjs.org/async/-/async-0.2.10.tgz
    npm http 200 http://registry.npmjs.org/appium-uiauto
    npm ERR! registry error parsing json
    npm ERR! SyntaxError: Unexpected end of input
    npm ERR! {"_id":"appium-uiauto","_rev":"29-bbaebafca03b18c4d69524ab56d49764","na
    me":"appium-uiauto","description":"appium uiauto ios driver","dist-tags":{"lates
    t":"0.0.15"},"versions":{"0.0.0":{"name":"appium-uiauto","version":"0.0.0","desc
    ription":"appium uiauto ios driver","main":"index.js","scripts":{"test":"echo \"
    Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://g

  • #10 楼 @lihuazhang 我找了 proxy 代理,然后安装 npm install appium 但是还是报解析的错误,请帮忙看看,谢谢!
    ary-cookies":"~0.1.1"},"scripts":{"test":"grunt travis","start":"node server.js
    },"devDependencies":{"mocha":"~1.8.1","should":"~1.2.1","grunt":"~0.4.0","grunt
    cli":"~0.1.6","wd":"git://github.com/admc/wd.git","assert":"~0.4.9","grunt-moch
    -test":"~0.2.0","difflib":"~0.2.4","prompt":"~0.2.9","grunt-contrib-jshint":"~0
    1.1","saucelabs":"~0.0.7","markdown":"~0.4.0"},"contributors":[{"name":"Authors
    ordered by first contribution"},{"name":"Dan Cuellar","email":"dancuellar@me.co
    "},{"name":"E. James Infusino","email":"jinfusino@gmail.com"},{"name":"Jason Hu
    gins","email":"hugs@saucelabs.com"},{"name":"Jason Carr","email":"jcarr@saucela
    s.com"},{"name":"Jayme Deffenbaugh","email":"jdeffenbaugh@me.com"},{"name":"Rom
    n Salvador","email":"roman.salvador@gmail.com"},{"name":"Luke Inman-Semerau","e
    ail":"luke.semerau@gmail.com"},{"name":"Pradeep Bishnoi","email":"pradeepbishno
    @gmail.com"},{"name":"Charles Nowacek","email":"charlie.nowacek@gmail.com"},{"n
    me":"Jayakumar Chinnappan","email":"jayakumareee21@gmail.com"},{"name":"Robin K
    ller","email":"robinthekeller@gmail.com"},{"name":"Adam Christian","email":"ada
    .christian@gmail.com"},{"name":"Jonathan Lipps","email":"jlipps@gmail.com"},{"n
    me":"Sebastian Tiedtke","email":"sebastiantiedtke@gmail.com"},{"name":"Jeremy A
    net"},{"name":"Bernard Kobos","email":"bkobos@extensa.pl"},{"name":"Santiago Su
    rez Ordoñez","email":"santiycr@gmail.com"},{"name":"Joe Mathes"}],"_id":"appium
    0.2.3","dist":{"shasum":"d1e63e4e179547df067883df4b2049856f66130d","tarball":"h
    tp://registry.npmjs.org/appium/-/appium-0.2.3.tgz"},"_npmVersion":"1.2.0","_npm
    ser":{"name":"jlipps","email":"jlipps@gmail.com"},"maintainers":[{"name":"admc"
    "email":"adam.christian@gmail.com"},{"name":"sourishkrout","email":"sebastianti
    dtke@gmail.com"},{"name":"jlipps","email":"jlipps@gmail.com"}]},"0.3.0":{"name"
    "appium","description":"Automation for Apps.","tags":["automation","javascript"
    ,"version":"0.3.0","author":{"name":"appium-discuss@googlegroups.com"},"reposit
    ry":{"type":"git","url":"https://github.com/appium/appium.git,"bugs":{"url":"}"
    ttps://github.com/appium/appium/issues"},"engines":["node"],"main":"./server.js
    ,"bin":{"appium":"./app/bin.js","instruments_client":"./instruments/client_bin.
    s"},"directories":{"lib":"./app"},"dependencies":{"underscore":"~1.4.3","colors
    :"~0.6.0-1","express":"~3.0.6","argparse":"~0.1.10","path":"~0.4.9","rimraf":"~
    .1.1","uuid-js":"~0.7.4","temp":"~0.5.0","winston":"~0.6.2","request":"~2.12.0"
    "bplist-parser":"~0.0.4","bufferpack":"0.0.6","node-bplist-creator":"~0.0.1","n
    de-uuid":"~1.4.0","underscore.string":"~2.3.1","glob":"~3.1.20","unzip":"~0.1.1
    ,"ncp":"~0.4.2","swig":"~0.13.5","async":"~0.2.6","mkdirp":"~0.3.5","binary-coo
    ies":"~0.1.1"},"scripts":{"test":"grunt travis","start":"node server.js"},"devD
    pendencies":{"mocha":"~1.8.1","should":"~1.2.1","grunt":"~0.4.0","grunt-cli":"~
    .1.6","wd":"git://github.com/admc/wd.git","assert":"~0.4.9","grunt-mocha-test":
    ~0.2.0","difflib":"~0.2.4","prompt":"~0.2.9","grunt-contrib-jshint":"~0.1.1","s
    ucelabs":"~0.0.7","namp":"~0.2.25"},"contributors":[{"name":"Authors ordered by
    first contribution"},{"name":"Dan Cuellar","email":"dancuellar@me.com"},{"name"
    "E. James Infusino","email":"jinfusino@gmail.com"},{"name":"Jason Huggins","ema
    l":"hugs@saucelabs.com"},{"name":"Jason Carr","email":"jcarr@saucelabs.com"},{"
    ame":"Jayme Deffenbaugh","email":"jdeffenbaugh@me.com"},{"name":"Roman Salvador
    ,"email":"roman.salvador@gmail.com"},{"name":"Luke Inman-Semerau","email":"luke
    semerau@gmail.com"},{"name":"Pradeep Bishnoi","email
    npm ERR! at Object.parse (native)
    npm ERR! at RegClient. (C:\Program Files\nodejs\node_modules\npm
    node_modules\npm-registry-client\lib\request.js:203:23)
    npm ERR! at Request.self.callback (C:\Program Files\nodejs\node_modules\npm
    node_modules\request\request.js:123:22)
    npm ERR! at Request.EventEmitter.emit (events.js:98:17)
    npm ERR! at Request. (C:\Program Files\nodejs\node_modules\npm\n
    de_modules\request\request.js:893:14)
    npm ERR! at Request.EventEmitter.emit (events.js:117:20)
    npm ERR! at IncomingMessage. (C:\Program Files\nodejs\node_modul
    s\npm\node_modules\request\request.js:844:12)
    npm ERR! at IncomingMessage.EventEmitter.emit (events.js:117:20)
    npm ERR! at _stream_readable.js:920:16
    npm ERR! at process._tickCallback (node.js:415:13)
    npm ERR! If you need help, you may report this entire log,
    npm ERR! including the npm and node versions, at:
    npm ERR! http://github.com/npm/npm/issues

    npm ERR! System Windows_NT 6.1.7600
    npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\no
    ejs\node_modules\npm\bin\npm-cli.js" "install" "appium"
    npm ERR! cwd C:\Users\cylboy
    npm ERR! node -v v0.10.26
    npm ERR! npm -v 1.4.3
    npm ERR! type unexpected_eos
    npm ERR!
    npm ERR! Additional logging details can be found in:
    npm ERR! C:\Users\cylboy\npm-debug.log
    npm ERR! not ok code 0

  • 佩服!资料实在是少的可怜,只能在论坛里多翻翻帖子,目前就卡在这了。