Report.LogHTML and unprintable characters

Bug reports.
atom
Posts: 357
Joined: Sun Dec 07, 2008 11:14 pm
Location: Dublin, Ireland

Report.LogHTML and unprintable characters

Post by atom » Wed Jul 28, 2010 4:55 pm

Hiya

It seems that the method Report.LogHTML does not check the message is valid
We have a case whereby we capture some text off the screen, and log it
the captured text contains the ENQ character, and when logged corrupts the ranorex log file

Can you confirm if the Report class does any checks to ensure valid xml is always produced
or should I write my own checks before logging?

Thanks

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

Re: Report.LogHTML and unprintable characters

Post by Support Team » Thu Jul 29, 2010 8:59 am

Hi,
atom wrote:Can you confirm if the Report class does any checks to ensure valid xml is always produced
or should I write my own checks before logging?
The Report.LogHTML doesn't check if the xml file is valid. So the best way would be to write your own checks before logging, e.g. using the System.Web.HttpUtility.HtmlEncode method:
http://msdn.microsoft.com/en-us/library/73z22y6h.aspx

Regards,
Peter
Ranorex Team
.
Image