PyWinAuto : need to check if a GroupBox has a scrollbar or not

27 Views Asked by At

My Groupbox will show a scroll bar if there are more than 5 entries added to it. I want to check if it has more than 5 values. The Inspect.exe shows me a attribute which I tried to use from code, but it was not available.

Page difference when there are more than 5 entries

I tried using :

is_scroll_pattern_available = element.get("IsScrollPatternAvailable", False)
is_scroll_pattern_available = element.element_info.get("IsScrollPatternAvailable", False)
is_scroll_pattern_available = element.element_info.get("ScrollPatternAvailable", False)
is_scroll_pattern_available = element.element_info.is_scroll_pattern_available()

The error I get is always no attribute, like :
{AttributeError} 'UAIElementInfo' object has no attribute 'is_scroll_pattern_available'

When I analyzed it in debug mode error seems fine, as there was none of these attribute present.

  • I tried using another property available in object, but that has logic which prevent me to use it, it remains 100% even if it has a scroll bar which is scrolled to last.
vertically_scroll_percent = element.iface_scroll.CurrentVerticalScrollPercent
return vertically_scroll_percent != 100.0

so I cant use this either.

  • In print_control_identifiers(), no information regarding scroll bar is given.
0

There are 0 best solutions below