Deciding if a test passes or fails
Hello
So I am new to Test Complete.
I have written some tests, recorded some scripts etc and it is going well.
However, I am unclear on how I can tell my test when I want it to pass or fail.
e.g. suppose I have a desktop application
I have a customers current $ balance
I simulate them depositing $100 into their account
I then want to check that their balance is $100 more than at the start of my test
All of this I can do.
But how do I tell TestComplete that the test passes if the balance is $100 more than at the start, but fails if it is not.
Currently TestComplete passes the test if it gets to the end without errors. If it gets to the end but the balance didn't go up by $100 is still passes the test as it is finished.
YO!
In script mode You can use these solutions:
2) Create condition and use within a:
- Log.Checkpoint()
- Log.Error() -> this one set test item to status "fail"
- Log.Warning()
3) You can also use the Runner class
https://support.smartbear.com/testcomplete/docs/reference/project-objects/items/script/runner/index.htm