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()