Java 如何在Robot框架中处理异常?
我想了解在Robot中异常处理是如何完成的。我想用一些通用的方法处理来自多个测试用例的异常。您可以使用以下两个关键字:Java 如何在Robot框架中处理异常?,java,python,robotframework,Java,Python,Robotframework,我想了解在Robot中异常处理是如何完成的。我想用一些通用的方法处理来自多个测试用例的异常。您可以使用以下两个关键字: 运行关键字并在失败时继续 运行关键字并根据您的要求忽略错误,但我建议使用第二个关键字,因为您将能够存储输出和状态 例如,可以定义测试拆卸关键字。在我的案例(web自动化解决方案)中,会发生以下情况: # Following closes potential alert and saves what the alert says ${message} = Run Keywo
例如,可以定义测试拆卸关键字。在我的案例(web自动化解决方案)中,会发生以下情况:
# Following closes potential alert and saves what the alert says
${message} = Run Keyword And Ignore Error Handle Alert timeout=0s
# This is a keyword that empties download/upload directories and saves their content for future debugging
Save Artefacts uploadDir=${global_uploadDir} downloadDir=${global_downloadDir} outputDir=${global_outputDir} testStatus=${TEST STATUS}
# This keyword just captures a screenshot in case that test failed
Run Keyword If Test Failed Capture Page Screenshot
“处理异常”是什么意思?什么例外?正在测试的应用程序中是否存在异常?