Page 1 of 1

Report missing information, when special symbols are in it

Posted: Wed Jun 27, 2012 8:50 pm
by slavikf
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

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

Posted: Thu Jun 28, 2012 12:38 pm
by Support Team
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

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

Posted: Thu Jun 28, 2012 3:31 pm
by slavikf
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
See, these data is missing in the report now (however, it still in the RXLOG file, its just not displayed):
corrupt.png

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

Posted: Thu Jun 28, 2012 3:36 pm
by slavikf
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]+@"|Security|ORM^O01|110125509|P|2.3|||||
PID|||"+Chart+@"||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]+@"^||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.

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

Posted: Fri Jun 29, 2012 12:54 pm
by Support Team
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