Report missing information, when special symbols are in it

Bug reports.
User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Report missing information, when special symbols are in it

Post by slavikf » Wed Jun 27, 2012 8:50 pm

I am testing application and sending some message back and forth.
So, i wanted to include this messages in the report.
And as soon, as i did - ALL info disappeared from the report. Not just message, but everything - all info, warnings, ...
As soon, as i remove my message from the report - all back to normal.

See attached report.
As soon, as you remove line 380 - it will look good. But as is - it is missing all the info.

I think, that is because of some special characters, which are in the message, but that should lead to such consequences.

Using Ranorex V 3.2.3 on Win R2 2008
Attachments
RanorexReport3.zip
Report
(129.92 KiB) Downloaded 249 times

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

Re: Report missing information, when special symbols are in it

Post by Support Team » Thu Jun 28, 2012 12:38 pm

Hi,

Did you mean line 371?
I added the text from line 371 to my report with Report.Info(...), but in my case it was successfully displayed.
Please check if it runs with Ranorex 3.3, if not could you send us the code you used to add the specific message to the report?

Regards,
Markus
Ranorex Support Team
.
Image

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Report missing information, when special symbols are in it

Post by slavikf » Thu Jun 28, 2012 3:31 pm

Yes, you are right, its line 371
Yes, reproduced in Ranorex 3.3

Attaching two screenshot, how my report appears WITH and WITHOUT that line
ok.png
OK report, without line 371
ok.png (42.25 KiB) Viewed 1208 times
See, these data is missing in the report now (however, it still in the RXLOG file, its just not displayed):
corrupt.png
report with data missing
corrupt.png (49.35 KiB) Viewed 1208 times

User avatar
slavikf
Posts: 104
Joined: Mon Sep 13, 2010 9:07 pm
Location: Toronto, Canada
Contact:

Re: Report missing information, when special symbols are in it

Post by slavikf » Thu Jun 28, 2012 3:36 pm

I am not sure, if code would be of any help, but here it is:
public static string Net_send (string msg) {
			Report.Info ("Sending: " + msg);
			string response1 = "";
			IPAddress ipAddress = IPAddress.Parse(HL7_IP);
			
			if (ipAddress != null)			{
			    IPEndPoint serverEndPoint = new IPEndPoint(ipAddress, HL7_Port);
			    byte[] receiveBuffer = new byte[1000];

			    try			    {
			        using (TcpClient client = new TcpClient(serverEndPoint))
			        {
			            using (Socket socket = client.Client)
			            {
			                socket.Connect(serverEndPoint);
			                byte[] data = Encoding.ASCII.GetBytes(msg);
			                socket.Send(data, data.Length, SocketFlags.None);
			                socket.Receive(receiveBuffer);
			                response1 = Encoding.ASCII.GetString(receiveBuffer);
			            }
			        }
			    }
			    catch (SocketException socketException)
			    {
			        Report.Warn ("Socket Exception : ", socketException.Message);
			    }
			}
			return response1;
		}
		
		public static void SendHL7 (string TC) {
			string Chart = TC+"_"+MWL_Orders[TC];
			string msg = @"MSH|^~\&|PMS|AutoTest|HIS||"+MWL_Orders[TC][email protected]"|Security|ORM^O01|110125509|P|2.3|||||
PID|||"[email protected]"||Last^First^Middle^Mr.^M.||19520307|M||1|123 Easy Street^^Hartland^WI^53029||262-555-1212|262-555-1212||||44125509|354125509|
PV1||I|A7NS^532^2^West^3^^Main^5^Critical Care||||^0^0|^0^0|^0^0|||||1|||^0^0||2412551|||||||||||||||||||||||||20120424000000|
ORC|NW|1^1||||||||||||2625551212^^^|
OBR||"+MWL_Orders[TC][email protected]"^||1^LHC^CTX^4^5||20120424000000|||||||||||^^^|20341355|224055|2||||OP|||||||||||||"; 
			Net_send (msg);
		}
Basically, string is generated from Socket buffer, which has x00 at the end, and when these x00 gets to string - report incorrectly displayed.
I already resolved that issue for myself by escaping (encoding) that string, but the fact is - Ranorex still has bug, displaying strings, which has x00 in it.

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

Re: Report missing information, when special symbols are in it

Post by Support Team » Fri Jun 29, 2012 12:54 pm

Hello,

Thank you for reporting. We are glad that you could manage to solve this issue.
The bug will be fixed in our next version.

Regards,
Bernhard
Ranorex Support Team
.
Image