Forum Discussion
Hi,
The TestCase that i metioned here was from a keyword tests
As mentioned, keyword tests do not return a "status". Think of each keyword test as a code function. If you write a function like so:
function noStatus(){ Log.Message('This is just a function that does stuff'); }
That function just executes and writes the log. There is no feedback from the code to indicate any status of that function. If, however, you write it like this:
function giveMeStatus(myStatus){ Log.Message('This is a function that returns a status'); if (myStatus) { return true; } else { return false; } }
Then you can do something like this
function checkMyStatus(){ if (giveMeStatus(true)) { Log.Message('giveMeStatus Passed'); } else { Log.Message('giveMeStatus Failed'); } }
It's all in the way you write your code. If you want your keyword tests to return a value that you can then check to see if it passed or failed, then you need to actually have it "return" a value using the Return operation. Otherwise, it just executes something.
- AlexKaras7 years agoChampion Level 3
Hi,
Besides mentioned by Robert, you may consider OnStopTest event in TestComplete. Within the code handler for this event you may get Log.ErrorCount and if it equals to zero you may assume that test passed.
Related Content
Recent Discussions
- 4 hours agoSubhraDas