Report error

Ranorex Spy, Recorder, and Studio.
Posts: 85
Joined: Fri Sep 09, 2016 1:05 pm

Report error

Post by MB_wiko » Wed Sep 06, 2017 2:13 pm

I inserted some usercode and I would write an error into the reports during running Ranorex. So I wrote following into user code:

Report.Log(ReportLevel.Error, "User", "Widget wurde nicht vergroessert.X: "+objX_new +":"+objX, repo.WebDocumentWikoWebTESTER2.GsResizeHandleGsResizeHandleBoth2HeaderInfo, new RecordItemIndex(13));

That works OK, I get the bug into the report:
Unbenannt.JPG (14.82 KiB) Viewed 605 times
But the whole testcase shows a success, but I had the error during the test:
Unbenannt3.JPG (12.59 KiB) Viewed 605 times
Unbenannt2.JPG (9.26 KiB) Viewed 605 times
How can I get an eror for the whole test case? Does anybody knows some tipps?

Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Report error

Post by krstcs » Wed Sep 06, 2017 3:01 pm

You need to use Report.Failure() instead of Report.Error().

Only Success and Failure counts are carried through to the total count at the top of the report.
Shortcuts usually aren't...

Posts: 85
Joined: Fri Sep 09, 2016 1:05 pm

Re: Report error

Post by MB_wiko » Thu Sep 07, 2017 1:32 pm

Thanks a lot this was the searched solution.