Page 1 of 1

Ranorex Reporting with Format

Posted: Thu Jun 15, 2017 10:48 am
by Utrehd
Hello

Currently I am polluting my report with a lot of messages and that makes things hard for debugging and error finding. My idea now is to format my messages in more readable way. Therefor I would like to use the new line command.

Code: Select all

"/n"


I have noticed that during that during the test run the "/n" works fine, but later it is not shown in the Report.

Window during test run:
1.png
Test Report:
2.png
The Code I used:

Code: Select all

    Ranorex.Report(ReportLevel.Success, "Correct State was found in point: \n \n \n \n \n asdasdasds \n \n \ndasd");

So how can I make a new line in a report message? My goal is it to create a new reporting class which allows me to collect a chunk of messages and pack them into one report message with some nicer formatting. So it will be easier for the reader to categorize stuff.

Thanks
Utrehd

Re: Ranorex Reporting with Format

Posted: Thu Jun 15, 2017 11:14 am
by odklizec
Hi,

Use "\r\n" instead of simple "\n". This should do the trick. At least it works for me ;)

Re: Ranorex Reporting with Format

Posted: Thu Jun 15, 2017 12:02 pm
by Utrehd
Perfect.
Thanks

Re: Ranorex Reporting with Format

Posted: Fri Jun 16, 2017 7:40 am
by Utrehd
Hey

One more thing, do you have somewhere a document with all those possible escape characters....
Or is it in general possible to use all of them just with an \r before ?

Re: Ranorex Reporting with Format

Posted: Fri Jun 16, 2017 7:50 am
by odklizec
Hi,

I'm afraid, I don't have a list of such characters. I only found this combination of characters actually works ;)

Re: Ranorex Reporting with Format

Posted: Fri Jun 16, 2017 8:05 pm
by krstcs
"/r/n" is the Windows OS version of the new line.

/r - Carriage Return
/n - New Line (Line Feed)

On *nix-based systems, you only need /n, but on Windows you need both, in the correct order.

Also, note that the Ranorex Report is an HTML file, and some formatting may be removed unless you specifically do it with the HTML specific format options.

The console output is formatted with Windows formatting, which may not carry over to the HTML/RXLOG Report file.