How to fail a test case in code?
Posted: Mon Jul 20, 2015 10:22 am
Hi i'm using Ranorex Studio. I have a test solution with a recording and user code file. The recording has a few steps(manual actions).
In my user code i set up a new thread, that periodically checks for any popups. If a popup appears, i want the test case to fail.
How do i fail the test case in code?
I tried :
But that only throws an exception, it doesnt fail the test case.
I have also tried:
With the above code, the report logs these errors but the test case still passes.
Any help would be appreciated.
In my user code i set up a new thread, that periodically checks for any popups. If a popup appears, i want the test case to fail.
How do i fail the test case in code?
I tried :
Code: Select all
Validate.NotExists(repo.ScriptError.SelfInfo);
I have also tried:
Code: Select all
Report.Failure("Validation", "my message");
Report.Log(ReportLevel.Failure, "failure message 2");
Any help would be appreciated.