Ranorex Spy option to black-list form by window attribute?

Ranorex Spy, Recorder, and Studio.
User avatar
Stub
Posts: 341
Joined: Fri Jul 15, 2016 1:35 pm

Ranorex Spy option to black-list form by window attribute?

Post by Stub » Tue Mar 10, 2020 12:48 pm

I can't see a way of doing this, but is there some means of black-listing a window element from Ranorex Spy based on an attribute other than process name?

I'm using Ranorex v9.2.1 because of a presently insurmountable issue with Ranorex v9.3.0. Our AUT is a legacy MFC/Win32 beast. Here are the options I was examining in Ranorex Spy Settings to give you an idea where I was looking:

RanorexSpySettingsWin32.png
RanorexSpySettingsWin32.png (12 KiB) Viewed 133 times

The problem here is that when I Ctrl+LWin to instant-track an element in our AUT, an unwanted element is 'correctly' being identified by Ranorex Spy. This basically means Ctrl+LWin doesn't work as I'd like in a very particular scenario applicable to our AUT. I can't black-list the window element that Ranorex Spy is locating by process name because its process is the AUT. So I want to black-list a particular Class value under the Ranorex Spy/NativewWindow attributes, for example.

I'm thinking this may need to be a UserVoice request unless I've missed an option I might be able to use?

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

Re: Ranorex Spy option to black-list form by window attribute?

Post by odklizec » Tue Mar 10, 2020 3:06 pm

Hi Stub,

As far as I know, there is unfortunately no such feature. The only thing I can think of is changing xpath weight, to increase/decrease weight of certain attribute? But I don't think this will help with your particular issue. Spy will most probably still select the 'unwanted' element and only its xpath will be constructed with different attributes?
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

User avatar
Stub
Posts: 341
Joined: Fri Jul 15, 2016 1:35 pm

Re: Ranorex Spy option to black-list form by window attribute?

Post by Stub » Fri Mar 13, 2020 10:54 am

Pavel,

That was an interesting suggestion which I have been following up between jobs these past few days. I've previously only dabbled with attribute weights and creating my own custom RanorexXpath weight rules. But I've now read the documentation and had a play with our AUT. This has led to a question that I'll post separately.

I have come to the same conclusion you suspected would apply, "Spy will most probably still select the 'unwanted' element and only its xpath will be constructed with different attributes?" Indeed, it just finds the element via a different route.

There does not appear to be a way to blacklist an element by adjusting its weight, and thus have it completely ignored. That would be super useful for me here if we could! I feel like I am going to submit a UserVoice change request for this actually.

We utterly depend upon GDICapture for our legacy AUT. RawTexts are incredibly useful for us. It's the reason I cannot upgrade to Ranorex v9.3.0 right now because something has been broken in that version. Because GDICapture is ENabled, each of our Text elements also have RawText and RawTextBlock elements found by RanorexSpy. So when I add a form and all of its children to a Repository, directly from RanorexSpy, I get a bajillion RawText elements that I then have to manually delete. It's quite painful.

If I could instead temporarily ENable a RanorexXpath Weight Rule that told Ranorex to utterly ignore them, that's be handy for us too. To avoid having to edit the GDICapture process and Windows class names list.

User avatar
Stub
Posts: 341
Joined: Fri Jul 15, 2016 1:35 pm

Re: Ranorex Spy option to black-list form by window attribute?

Post by Stub » Fri Mar 13, 2020 11:12 am