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
You do not have the required permissions to view the files attached to this post.
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