I am trying to get the value in the spinner out of it to check that it was entered correctly through an AutomationElement in C#. What I am currently doing is attempting get it out through the TryGetCurrentPattern
as shown below, however it only returns 0.0 for the value despite having a different value (such as 1) displayed in the spinner.
if (spinnerAutoEle.TryGetCurrentPattern(RangeValuePattern.Pattern, out pattern))
{
var valueRangePattern = (RangeValuePattern)pattern;
return valueRangePattern.Current.Value;
}
Also, I noticed when looking at the valueRangePattern.Current
the field for maximum and minimum values are always 0.0 as well despite the spinner being limited. I have also tried getting a ValuePattern
out of the spinner but it will not go into the if statement if (spinnerAutoEle.TryGetCurrentPattern(ValuePattern.Pattern, out pattern))
. Is it possible to get the numerical value out of the Spinner in this way?