Return False from a KeywordTest on any Error
Hi all,
I'm on a mission to make my tests run endto end without stopping because there was one failure.
I know you can configure TC to continue/stop on error, but what I'm trying to acheive is to be able to run consecutive KWTs and if one KWT fails, all the KWTs that follow that are dependant on this KWT will get cut out, but the ones that aren't will still be run. e.g.
KWT CreateOrder:
Navigate to page -> enter data -> save ->return true/false
KWT VerifyBasket:
Open basket page -> check fields ->return true/false
Now, you have KWT OrderProcess:
KWT CreateOrder
if(lastresult==true)
KWT VerifyBasket
KWT ChangeProfile
As you can see, KWTChangeProfile is not dependant on KWT CreateOrder at all, so should still run, it's just KWT VerifyBasket that needs to be left out.
Now...
I can write a KWT that returns a true/false at the end of the KWT, but how do you handle if one of the steps halfway down the KWT logs an error ? If TC is configured to stop, KWT ChangeProfile won't happen. If TC doesn't stop, KWT VerifyBasket will error all over the place and keep wasting time trying to find objects that don't exist etc.
It's not reasonable to check each and every single possible error in all environments on each step of the KWT and return false, so is there a way to tell my KWT onError, return false ?
Could it be as simple as wiring up an event like so ?
function GeneralEvents_OnLogError(Sender, LogParams)
{
return false;
}