我是Robot的新手,正在学习编写逻辑和测试用例。
我有一个测试套件 monitoring.robot ,其中包含很多测试用例。测试用例,例如Homepage web1,homepage web2,home web3 ...等。 如果任何步骤失败,那么应该停止执行直到交易结束吗?
monitoring.robot
Test Case## Heading ##
echo Trans01_WebSites-helloPublicWebsite
open https://www.morganre.com/
assertTitle abcd Group | abcd
echo Trans02_WebSites-CorporateSolutions
open https://corporatesolutions.hello.com/
assertTitle abcd Corporate Solutions
echo Trans03_WebSites-OpenMinds
open https://openminds.hello.com/
assertTitle abcd - Open Minds
echo Trans04_WebSites-Arthello
open http://art.hello.com/
assertTitle Art at abcd
close win_ser_local
Close All Browsers
即使在任何测试用例中间发生任何故障,也不应停止执行。
答案 0 :(得分:5)
机器人框架具有有用的方法:
Run Keyword And Continue On Failure open https://www.morganre.com/
Run Keyword And Ignore Error open https://www.morganre.com/
两种方法都适合您,但是第一个将显示具有失败状态的失败方法,第二个将忽略该错误。
有关详细信息,请参阅http://robotframework.org/robotframework/latest/libraries/BuiltIn.html