鍍金池/ 問答/Linux  網(wǎng)絡(luò)安全/ 求助:python-appium,每次運(yùn)行時(shí)都要重啟APP

求助:python-appium,每次運(yùn)行時(shí)都要重啟APP

每次運(yùn)行命令時(shí)APP都要重啟,這樣運(yùn)行時(shí)間就會(huì)很長

appium-v1.4.16.1

相關(guān)代碼

desired_caps = {}
desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '6.0'
desired_caps['deviceName'] = 'Android Emulator'
desired_caps['appPackage'] = 'com.eg.android.AlipayGphone'
desired_caps['appActivity'] = 'com.eg.android.AlipayGphone.AlipayLogin'
desired_caps['noReset'] = True
#desired_caps['autoLaunch'] = False 加上這句會(huì)報(bào)錯(cuò)
driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
print('1')

driver.find_element_by_id('com.alipay.android.phone.openplatform:id/collect_layout').click()

有辦法在app已經(jīng)運(yùn)行的情況下,找到控件直接執(zhí)行點(diǎn)擊命令嗎?

回答
編輯回答
脾氣硬

啟用 noReset,不是 no reset,見 http://appium.io/docs/en/writ...

2017年7月24日 04:05