报错如下
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)