Greg
Greg

Reputation: 1377

how to fail a test in Testcomplete programmatically?

I am trying to programmatically fail a test in TestComplete What code do I have to write to set a vb script test as failed in TestComplete? Thank you

Upvotes: 4

Views: 2229

Answers (3)

Sethi
Sethi

Reputation: 1

Log.Error statements throws an error programmatically and fails the test.

Sample:-

Log.Error "Any Error message"

Upvotes: 0

Zakir Sayed
Zakir Sayed

Reputation: 200

Try Log.Error("Some error message") and change the Project properties to stop test on error.

Upvotes: 3

Helen
Helen

Reputation: 97962

Something like Runner.Halt maybe?

The Halt method stops the script execution and posts an error string specified by ErrorMsg to the test log.

The method stops the entire test run, that is, for instance, if you are executing a project or project suite test, the method will stop the entire project or project suite run.

Upvotes: 0

Related Questions