[英]็Exit the test in Robot Framework
I want to exit test in the test case.我想在测试用例中退出测试。 And do not want the report to show the number of test cases (TC003) that exit test In the example below,并且不希望报告显示退出测试的测试用例数(TC003) 在下面的示例中,
*** test cases ***
TC001
Run Keyword If '1'=='1' Log To Console xx
TC002
Run Keyword If '2'=='2' Log To Console xx
TC003
Run Keyword If '3'!='3' Exit Test
How do I use it?我如何使用它? You can guide me你可以指导我
I don't think there's anything you can do.我不认为你有什么可以做的。 Once the test starts running, there's no way to remove it from the reports and logs.一旦测试开始运行,就无法将其从报告和日志中删除。
It sounds like you're trying to skip a test under certain circumstances.听起来您在某些情况下试图跳过测试。 If so, it will be able to mark a test as skipped (versus pass/fail) in robot framework 4.0, though it will still show up in the logs and reports.如果是这样,它将能够在机器人框架 4.0 中将测试标记为跳过(相对于通过/失败),尽管它仍会显示在日志和报告中。
If you really don't want it in the reports, you can write a script that removes the tests from the output.xml file and then regenerates the html logs and reports using rebot.如果您真的不希望它出现在报告中,您可以编写一个脚本,从 output.xml 文件中删除测试,然后使用 rebot 重新生成 html 日志和报告。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.