Appium 求助 appium 设备不在线问题。报错如下;

华玺 · 2017年09月05日 · 最后由 South 回复于 2017年09月05日 · 1900 次阅读

报错如下
selenium.common.exceptions.WebDriverException: Message: A new session could not be created. (Original error: An unknown server-side error occurred while processing the command. (Original error: unknown error: Device 63165a4 is not online
(Driver info: chromedriver=2.18.343845 (73dd713ba7fbfb73cbb514e62641d8c96a94682a),platform=Windows NT 10.0 x86_64)))

脚本如下
#usr/bin/python
#encoding:utf-8
import time
from appium import webdriver

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = '63165a4'
desired_caps['appPackage'] = 'com.android.browser'
desired_caps['appActivity'] = '.BrowserActivity'
desired_caps['browserName'] = 'browser'
desired_caps["unicodeKeyboard"] = "True"
desired_caps["resetKeyboard"] = "True"
driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

driver.find_element_by_id("ll").send_keys("monkey")
driver.find_element_by_id("mn").click()

try:
if driver.find_element_by_id("mn").is_displayed():
print "fail"
except Exception, e:
print e
print "pass"

driver.quit()

time.sleep(5)

共收到 1 条回复 时间 点赞

adb devices 看设备在不在线

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册