• python+appium1.6.5 还是搞不定,抓不到 toast,有人指点下吗?
    desired_caps['automationName'] = 'uiautomator2'
    启动 app 也没问题,appium 没有 error,就是没找到

    def test_find_toast(driver,message,timeout,poll_frequency):
    message = '//*[@text=\'%s\']' %message
    print message
    element = WebDriverWait(driver,timeout,poll_frequency).until(expected_conditions.presence_of_element_located((By.XPATH,message)))
    print element

    def test_find_toast2(driver,message):
    try:
    driver.find_element_by_xpath('//*[@text=\'%s\']' %message)
    print "find toast message %s" %message
    except:
    print "not find toast message %s" %message

  • 试试 desired_caps['noReset'] = True 呢,python,java 的话,你设置这个值为 true 试试。
    我也发现类似的问题,1.4 的时候,启动 app 的时候不会清 app 数据,但是昨天装 appium1.6.5,启动 app 的时候会清除 app 数据,我这样设置就 OK 了