Ranorex Reporting with Format

Class library usage, coding and language questions.
Utrehd
Posts: 4
Joined: Tue Nov 08, 2016 10:06 am

Ranorex Reporting with Format

Post by Utrehd » Thu Jun 15, 2017 10:48 am

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
You do not have the required permissions to view the files attached to this post.

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Reporting with Format

Post by odklizec » Thu Jun 15, 2017 11:14 am

Hi,

Use "\r\n" instead of simple "\n". This should do the trick. At least it works for me ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Utrehd
Posts: 4
Joined: Tue Nov 08, 2016 10:06 am

Re: Ranorex Reporting with Format

Post by Utrehd » Thu Jun 15, 2017 12:02 pm

Perfect.
Thanks

Utrehd
Posts: 4
Joined: Tue Nov 08, 2016 10:06 am

Re: Ranorex Reporting with Format

Post by Utrehd » Fri Jun 16, 2017 7:40 am

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 ?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Ranorex Reporting with Format

Post by odklizec » Fri Jun 16, 2017 7:50 am

Hi,

I'm afraid, I don't have a list of such characters. I only found this combination of characters actually works ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

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

Re: Ranorex Reporting with Format

Post by krstcs » Fri Jun 16, 2017 8:05 pm

"/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.
Shortcuts usually aren't...