#appium的错误截图跟webdriver大同小异~
#捕捉百度输入框异常
try:
    driver.find_element_by_id("kwsss").send_keys("selenium")
    driver.find_element_by_id("su1").click()
except:
    driver.get_screenshot_as_file("/home/fnngj/python/error_png.png")


↙↙↙阅读原文可查看相关链接,并与作者交流