Unable to validate all the properties of WPF control in UI test

Ask general questions here.
Megha
Posts: 4
Joined: Mon Feb 04, 2019 5:13 am

Unable to validate all the properties of WPF control in UI test

Post by Megha » Mon Feb 04, 2019 5:22 am

Hi,

I am trying to automate testing of all the properties of UI elements(button,combo box etc) but not able to achieve it completely.
Opacity, Font Family, Font Style, Padding, corner radius and margin cannot be validated. Moreover the properties on hover is not at all extractable.
Is there any way out in Ranorex to achieve a full fledged test automation of UI controls( mostly design based validations of control)?

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4421
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to validate all the properties of WPF control in UI test

Post by odklizec » Mon Feb 04, 2019 9:24 am

Hi,

I'm afraid, without seeing your app, or at very least a Ranorex snapshot of the AUT, there is not much anyone here can do or suggest. Could you please post the snapshot (NOT screenshot) of your app?

Here are some general suggestions:
Have you tried different WPF settings in Ranorex (to get different attributes)?
What version of Ranorex do you use? Make sure you are using the most recent one (8.3.2).
For hover/onmouseover started elements (typically tooltips), you must use Instant Tracking feature.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Megha
Posts: 4
Joined: Mon Feb 04, 2019 5:13 am

Re: Unable to validate all the properties of WPF control in UI test

Post by Megha » Wed Feb 06, 2019 7:35 am

Hi,

Thanks for the reply. PFA the snapshot of a control(button) and let me know if anything can be done to explore the unidentified properties of control like margin, opacity, padding in Ranorex or even from wpf side.
test.rxsnp
Button Snapshot
(211.52 KiB) Downloaded 1 time
Control 's properties during on hover was not captured even through Instant Tracking feature. We had tried that too.
We are using WPFImproved plugins and ranorex version is 8.3.2(latest one).

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 4421
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Unable to validate all the properties of WPF control in UI test

Post by odklizec » Wed Feb 06, 2019 8:54 am

Hi,

Thanks for the snapshot. I see that some of the text-related attributes are missing (opacity is there). I would suggest to examine the control in question with MS Inspect tool. If Inspect recognizes the missing/empty attributes, then the problem is most probably in Ranorex and it's something to be fixed. On the other hand, if the attributes you want to validate are not available even in Inspect, it's because of missing/incorrect implementation of the attributes in given control? It may eventually be possible to extract the missing info, using InvokeRemotely, as discussed for example here:
finding-the-colour-of-a-cell-in-an-infr ... html#p3622
But this technique requires deep knowledge of the problematic control (its implementation).
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

Megha
Posts: 4
Joined: Mon Feb 04, 2019 5:13 am

Re: Unable to validate all the properties of WPF control in UI test

Post by Megha » Thu Feb 07, 2019 8:09 am

Hi,

I have tried using Invokeremotely for getting opacity of button (opacity displayed in spy is not the correct property. It has been implemented in different way for this app). I am getting the following error :
" Cannot convert type 'System.Windows.Forms.Control' to 'System.Windows.Controls.Button' via a reference conversion, boxing conversion, unboxing conversion, wrapping conversion, or null type conversion (CS0039) "

Since winforms and wpf are different, it is not being done. Is it a limitation?