Automating WPF app with layers, Ranorex only seeing topmost

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
boroop
Posts: 2
Joined: Fri Mar 01, 2013 1:56 pm

Automating WPF app with layers, Ranorex only seeing topmost

Post by boroop » Fri Mar 01, 2013 2:16 pm

I am trying to automate a WPF app designed in XAML and coded up in C#. The app has many different layers (views) that we show/hide, enable/disable depending on what the app's user is doing at the present moment.

The problem I am having is that the recording session is only seeing the topmost layer and not recording a button click on the lower layer (which is really what happens when the user clicks the mouse). I know I can manually add the Mouse click operation by dragging the item from the repository up to the recording, but I cannot validate the control (or the full layer and children at once) while learning.

I have found that I can add a validate step to my script for 1 single property for my control. But if I want to validate the state of a button, I'd like to compare the following properties all at once (without creating individual validate steps):

* Enabled
* Visible
* Text
* Size
* IsKeyboardFocusable

Is this possible in my scenario outlined above?

Thanks,
Bo

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

Re: Automating WPF app with layers, Ranorex only seeing topmost

Post by Support Team » Mon Mar 04, 2013 1:56 pm

Hello,

Could it be that the UI Automation is not implemented correctly? Ranorex uses the UI Automation accessibility framework to recognize the elements. Is it possible to recognize the elements with Microsoft inspect? If you are not able to recognize the elements with Microsoft inspect you should check the UI Automation implementation of your application.
Thank you!

Regards,
Bernhard
.
Image

boroop
Posts: 2
Joined: Fri Mar 01, 2013 1:56 pm

Re: Automating WPF app with layers, Ranorex only seeing topmost

Post by boroop » Tue Mar 05, 2013 8:50 pm

Could it be that the UI Automation is not implemented correctly?
Possibly?

But looking at the AUT with this tool ( http://uiautomationverify.codeplex.com/ ), it shows me the button that your tool misses during the automation.

I say "during the automation" because I am able to see the control in the repository. If it was completely unavailable it wouldn't appear in the repository would it?


Thanks,
Bo

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

Re: Automating WPF app with layers, Ranorex only seeing topmost

Post by Support Team » Wed Mar 06, 2013 5:40 pm

Hello,

That means you are able to see the button in Spy?
It sounds like a timing issue. It could be that the button is not loaded ant the moment of the validation.
Please insert a delay before your validate action in order to check that.

Regards,
Bernhard
.
Image