Page 1 of 1

Report shows failure though expected and actual are same

Posted: Tue Mar 19, 2013 2:19 pm
by Shruti
Hello All,

Ranorex reporting is not working as expected for me.
Even when the actual and expected value is same, it shows failure.
I am not able to find out the difference between actual and expected from the information in the report.

Here is the information from report:

Attribute 'TagValue' of element for item 'PPT_SKILLSRepository.ProjectCreationTool.InstructionsContainer.Property_7_value' does not match the specified value (actual='[{"ID":"1","EID":"1","HasValue":"True","DisplayValue":"16.13","ESDesc":"[Rectangular Callout] Para1","Info":null},{"ID":"2","EID":"2","HasValue":"True","DisplayValue":"10.00","ESDesc":"[Title] Slide1","Info":null},{"ID":"3","EID":"3","HasValue":"True","DisplayValue":"10.00","ESDesc":"[Subtitle] ","Info":null},{"ID":"4","EID":"4","HasValue":"True","DisplayValue":"2.71","ESDesc":"[Rectangle] Rect-text","Info":null},{"ID":"5","EID":"5","HasValue":"True","DisplayValue":"0.73","ESDesc":"[Isosceles Triangle] text1","Info":null},{"ID":"6","EID":"6","HasValue":"True","DisplayValue":"1.36","ESDesc":"[Flowchart: Process] 1234 ","Info":null},{"ID":"7","EID":"7","HasValue":"True","DisplayValue":"2.23","ESDesc":"[Action Button: End] ","Info":null},{"ID":"8","EID":"8","HasValue":"True","DisplayValue":"0.62","ESDesc":"[Up-Down Arrow] ","Info":null},{"ID":"9","EID":"9","HasValue":"True","DisplayValue":"0.62","ESDesc":"[Moon] ","Info":null}]', expected='[{"ID":"1","EID":"1","HasValue":"True","DisplayValue":"16.13","ESDesc":"[Rectangular Callout] Para1","Info":null},{"ID":"2","EID":"2","HasValue":"True","DisplayValue":"10.00","ESDesc":"[Title] Slide1","Info":null},{"ID":"3","EID":"3","HasValue":"True","DisplayValue":"10.00","ESDesc":"[Subtitle] ","Info":null},{"ID":"4","EID":"4","HasValue":"True","DisplayValue":"2.71","ESDesc":"[Rectangle] Rect-text","Info":null},{"ID":"5","EID":"5","HasValue":"True","DisplayValue":"0.73","ESDesc":"[Isosceles Triangle] text1","Info":null},{"ID":"6","EID":"6","HasValue":"True","DisplayValue":"1.36","ESDesc":"[Flowchart: Process] 1234 ","Info":null},{"ID":"7","EID":"7","HasValue":"True","DisplayValue":"2.23","ESDesc":"[Action Button: End] ","Info":null},{"ID":"8","EID":"8","HasValue":"True","DisplayValue":"0.62","ESDesc":"[Up-Down Arrow] ","Info":null},{"ID":"9","EID":"9","HasValue":"True","DisplayValue":"0.62","ESDesc":"[Moon] ","Info":null}]').




On comparing the values, expected and actual values are found to be same.



Thanks and Regards,
Shruti

Re: Report shows failure though expected and actual are same

Posted: Tue Mar 19, 2013 4:07 pm
by Ciege
You could have some unprintable characters in one line that are not in the other (such as a carriage return and/or new line). Try stripping out and \r and \n and comparing again.

Also, if you have both those values assigned to a variable, you can compare them char by char in a small loop and report on exactly which char position is causing you the issue.

Re: Report shows failure though expected and actual are same

Posted: Wed Mar 20, 2013 8:50 am
by Shruti
Removing spaces from the expected and actual value before comparing them solves the issue.
thanks



Regards,
Shruti