Page 1 of 1

GDI Class Name Changing Randomly

Posted: Mon Apr 11, 2016 4:03 pm
by IanKnight
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

Re: GDI Class Name Changing Randomly

Posted: Tue Apr 12, 2016 9:32 am
by odklizec
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.

Re: GDI Class Name Changing Randomly

Posted: Thu Apr 14, 2016 3:39 pm
by IanKnight
Thanks very much.

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