Page 1 of 1

Automating WPF app with layers, Ranorex only seeing topmost

Posted: Fri Mar 01, 2013 2:16 pm
by boroop
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

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

Posted: Mon Mar 04, 2013 1:56 pm
by Support Team
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

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

Posted: Tue Mar 05, 2013 8:50 pm
by boroop
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

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

Posted: Wed Mar 06, 2013 5:40 pm
by Support Team
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