I encounter a problem and need your help
For the values in text box validation, I want to compare the value, but not string.
Take the text box below for example
What I expected: 1.00 and 1.0000 are considered as successful
Actual: 1.00 are considered as failed
Thanks in advance!
Numerical comparison
Numerical comparison
- Attachments
-
- Ranorex case
- 02-07-2018 06-59-30.png (20.01 KiB) Viewed 685 times
-
- Product to be tested
- 02-07-2018 06-59-09.png (25.54 KiB) Viewed 685 times
Re: Numerical comparison
Hi,
I'm afraid, this kind of comparison/validation is not possible without using code. You would have to convert the string values into numbers and then compare them using for example using CompareTo method. Eventually, it may be possible to use Validate action, but instead of "AttributeEqual" you should try "AttributeRegex" and some kind of regex pattern, which would ignore redundant/missing decimal numbers. But I still think that using CompareTo is better way of comparing numbers?
I'm afraid, this kind of comparison/validation is not possible without using code. You would have to convert the string values into numbers and then compare them using for example using CompareTo method. Eventually, it may be possible to use Validate action, but instead of "AttributeEqual" you should try "AttributeRegex" and some kind of regex pattern, which would ignore redundant/missing decimal numbers. But I still think that using CompareTo is better way of comparing numbers?

Pavel Kudrys
Ranorex explorer at Descartes Systems
Please add these details to your questions:
Ranorex explorer at Descartes Systems
Please add these details to your questions:
- Ranorex Snapshot. Learn how to create one >here<
- Ranorex xPath of problematic element(s)
- Ranorex version
- OS version
- HW configuration
Re: Numerical comparison
Hi,
Thanks for your help. I will try those two methods then
Thanks for your help. I will try those two methods then