Report shows failure though expected and actual are same

Ranorex Spy, Recorder, and Studio.
Shruti
Posts: 25
Joined: Thu Sep 06, 2012 9:13 am

Report shows failure though expected and actual are same

Post by Shruti » Tue Mar 19, 2013 2:19 pm

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

User avatar
Ciege
Ranorex Guru
Posts: 1335
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: Report shows failure though expected and actual are same

Post by Ciege » Tue Mar 19, 2013 4:07 pm

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.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

Shruti
Posts: 25
Joined: Thu Sep 06, 2012 9:13 am

Re: Report shows failure though expected and actual are same

Post by Shruti » Wed Mar 20, 2013 8:50 am

Removing spaces from the expected and actual value before comparing them solves the issue.
thanks



Regards,
Shruti