Report.LogHtml breaks report

Bug reports.
lakibuk
Posts: 8
Joined: Wed Mar 02, 2016 12:30 pm

Report.LogHtml breaks report

Post by lakibuk » Wed Mar 02, 2016 12:37 pm

Code: Select all

Report.LogHtml(ReportLevel.Info, "CheckXML", "<textarea><n1:tag></n1:tag></textarea>");
This line breaks the report with message:
"Data file (TestXXX_20160302_122145.rxlog.data) or transformation file is missing."

Code: Select all

<textarea><n1:tag></n1:tag></textarea>
is valid html code though and can be opened in any web browser.

Any work around?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Report.LogHtml breaks report

Post by Support Team » Fri Mar 04, 2016 10:01 am

Hi lakibuk,

I'm not exactly sure, but I think what you want to achieve is to have a textarea containing the visible
string "<n1:tag></n1:tag>" shown to the user. However, Ranorex considers this
string as XML-tag, since it starts with a less-than character. Ranorex tries to
interpret it, but fails since it contains a colon. In order to tell Ranorex
that it should not try to interpret the string, I would suggest you to use
the XML entities instead of the less-than and greater-than characters resp.
This technique is often referred to as "escaping" a string.

Applied to your example I would change the code to
Report.LogHtml(ReportLevel.Info, "CheckXML", "<textarea><n1:tag></n1:tag></textarea>");
Hope that helps!
Stefan
.
Image

lakibuk
Posts: 8
Joined: Wed Mar 02, 2016 12:30 pm

Re: Report.LogHtml breaks report

Post by lakibuk » Mon Mar 07, 2016 10:11 am

This works fine. Thank you!