Page 1 of 1

How to find associated scrollbars in WPF applications

Posted: Thu Jan 03, 2013 7:34 pm
by merklh
Hi,
The app I am trying to automate has a WPF DataGrid that can contain text boxes that may be scrollable. This means the grid has scrollbars and the text boxes have scrollbars too. Is there a way to find out which scrollbar if pressed would scroll which field? I am having trouble with this because by using control templates it's hard to know where the scrollbars will be in the visual tree.

I hope this makes sense.

Thanks!

Re: How to find associated scrollbars in WPF applications

Posted: Fri Jan 04, 2013 10:21 am
by Support Team
Hi,

I order to analyze the issue we would need a Ranorex snapshot file of your application including the different scrollbars.
Following link will show you how to generate a snapshot file:
Creating Ranorex Snapshot Files.
In general if an element can be uniquely identified by the RxPath it doesn't matter where the element will be shown, Ranorex will find it and will execute the action on it.

Regards,
Markus

Re: How to find associated scrollbars in WPF applications

Posted: Tue Jan 08, 2013 2:18 am
by merklh
Hi,

I am attaching a sample WPF project which contains nested DataGrid and ItemsControls elements. The app I need to automate is a bit more complex and the scroll bars can be included with control templates so it can't be predicted where in the control hierarchy the scroll bars will be. So what I am looking for is way to find the scrollbar for a window or find the window a scrollbar is attached to.

Am I trying to do something impossible and I have to know where the scroll bars are in the hierarchy? Or can this be done in a generic way?

thanks!

Re: How to find associated scrollbars in WPF applications

Posted: Tue Jan 08, 2013 3:01 pm
by Support Team
Hello,

Unfortunately, scroll bars could not be identified since they are not implemented as a control (e.g. <ScrollBar> or <ScrollViewer> tag). These scroll bars don't offer UI Automation features in order to work with test automation software.

Regards,
Markus (T)