Appium (为啥一直报 A new session could not be created) 请教各位大神...拜托拜托!!!

wengzexiong · 2018年01月03日 · 2347 次阅读

coding=utf-8

from utils.config import APK_PATH
from appium import webdriver

#HUAWEI
def HUAWEI():
desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['noReset'] = True # 不需每次都安装 apk
desired_caps['app'] = newlist
desired_caps['deviceName'] = 'DU2SSE146L013087'
desired_caps['unxcodeKeyboard'] = 'True'
desired_caps['resetKeyboard'] = 'True'
# desired_caps['appWaitActivity'] = 'io.dcloud.HBuilder'
# desired_caps['appActivity'] = 'io.dcloud.PandoraEntry'

return desired_caps

newlist = APK_PATH + '\' + 'HBuilder_8.9.1.apk'
print(newlist)

a = HUAWEI()
print(a)

driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', a)

driver.find_element_by_xpath('//*[@id="container"]/div[4]/a[1]').click()


共收到 2 条回复 时间 点赞

你那 newlist 是啥玩意?建议先学好 python 吧!

匿名 #1 · 2018年03月05日

appium server 没启动吧?

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