How to find associated scrollbars in WPF applications

Class library usage, coding and language questions.
merklh
Posts: 24
Joined: Thu Jan 03, 2013 6:55 pm

How to find associated scrollbars in WPF applications

Post by merklh » Thu Jan 03, 2013 7:34 pm

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!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to find associated scrollbars in WPF applications

Post by Support Team » Fri Jan 04, 2013 10:21 am

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
.
Image

merklh
Posts: 24
Joined: Thu Jan 03, 2013 6:55 pm

Re: How to find associated scrollbars in WPF applications

Post by merklh » Tue Jan 08, 2013 2:18 am

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!
Attachments
2030107RanorexSampleScrolling.zip
Sample project
(534.38 KiB) Downloaded 206 times

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: How to find associated scrollbars in WPF applications

Post by Support Team » Tue Jan 08, 2013 3:01 pm

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)
.
Image