GDI Class Name Changing Randomly

Ask general questions here.
IanKnight
Posts: 33
Joined: Thu Feb 21, 2013 12:52 pm

GDI Class Name Changing Randomly

Post by IanKnight » Mon Apr 11, 2016 4:03 pm

Hi,

We have been using GDI capture on a diary control for quite a while with the same GDI class name.

However in a recent build the class name seems to be regenerated each time our application is started

e.g. these are two messages about the same control a few minutes apart looking at the same control -

The class name 'WindowsForms10.Window.8.app.0.138a9ad_r14_ad1' has been added to the list of GDI Capture classes. Ranorex will now try to capture RawText elements within elements having the same class name.

The class name 'WindowsForms10.Window.8.app.0.239ffce_r14_ad1' has been added to the list of GDI Capture classes. Ranorex will now try to capture RawText elements within elements having the same class name.


I know that this will be a developer issue on our application, but our developers don't know what they have changed to make the class name change, so this is a general query to see if anyone has had this issue before and if so how they solved it.

Thanks for any help.

Ian

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

Re: GDI Class Name Changing Randomly

Post by odklizec » Tue Apr 12, 2016 9:32 am

Hi Ian,

I don't know how to make the class names persistent, but I think there is a simple solution of your problem. The GDI Capture list supports regular expressions. So all you need to do is to replace the changing part of clas sname string with regex. For example, something like this should do the trick...
WindowsForms10\.Window\.8\.app\.0\.(.*)_r14_ad1
Eventually, I would add regexes also to other parts of the string containing version numbers.
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

IanKnight
Posts: 33
Joined: Thu Feb 21, 2013 12:52 pm

Re: GDI Class Name Changing Randomly

Post by IanKnight » Thu Apr 14, 2016 3:39 pm

Thanks very much.

That does seem to be working, not sure what it means in terms of object recognition long term though.