Page 1 of 1

Text field contains text and number, visible is number only

Posted: Fri Sep 09, 2016 8:50 am
by Speedboat
Hi

How is it possible that all usable attributes of text field are different to what is displayed?
The following example is from the Windows 10 Calculator result field.
Text: 'Display is 9'
Caption: 'Display is 9'
Visible: '9'

1) How is this technically possible
2) How to extract the number

Windows 10 / 64 bit
Ranorex 5.4.6

Thanks
Speedboat

Re: Text field contains text and number, visible is number only

Posted: Fri Sep 09, 2016 9:10 am
by odklizec
Hi,

You can for example use Get Value action, with regular expression like this:
[0-9\.]+
This should return number (including decimal numbers) from given string.

Re: Text field contains text and number, visible is number only

Posted: Fri Sep 09, 2016 11:59 am
by Speedboat
However, any idea how this "effect" is constructed that the displayed value differs from attribute values?
"It sounds to me like a kind of misuse of windows objects"

Thanks for the regex

Re: Text field contains text and number, visible is number only

Posted: Fri Sep 09, 2016 12:11 pm
by odklizec
Sorry, don't have any clue how exactly this element is created. You know, it's a MS calculator, so virtually anything is possible ;) If I were you, I would not care much about this kind of problem. You are surely not going to test the MS calc app? ;)