Decimal points not capturing

Ranorex Spy, Recorder, and Studio.
NewLearner
Posts: 29
Joined: Wed Jan 15, 2014 3:32 pm

Decimal points not capturing

Post by NewLearner » Thu Jan 16, 2014 11:38 am

Hi
while recording a test case I have used validate statement to validate a quantity value in a table, quantity value is 0.0000, while capturing quantity validation it is showing 0.0000 in the image box but in the property none of the value contain 0.0000 but accessible value and text property values are 0.
while rerunning this script this validation field get error out due to 0 not equal to 0.0000.
please let me know why ranorex not taking 0.0000.
screenshot attached


Thanks in Advance
Madhavan
Attachments
spy.png
spy.png (118.91 KiB) Viewed 2482 times

krstcs
Ranorex Guru
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: Decimal points not capturing

Post by krstcs » Thu Jan 16, 2014 2:42 pm

The field is being formatted at run-time. The actual value is 0, but it displays it with the trailing ".0000" due to field formatting, which Ranorex can't see.

You will most likely need to write some user code that converts the number into a string with the correct format for you so you can compare it, if you are worried about the formatting.

Or, if you aren't worried about the formatting, you could convert all strings to numbers (float/decimal probably) and compare the numbers, again in user code. 0 == 0.0000 in decimal notations.
Shortcuts usually aren't...

NewLearner
Posts: 29
Joined: Wed Jan 15, 2014 3:32 pm

Re: Decimal points not capturing

Post by NewLearner » Thu Jan 16, 2014 5:13 pm

Thank you for the details, I have added the code for this.

Madhavan