Repository using the QT library

Class library usage, coding and language questions.
Posts: 1
Joined: Thu May 02, 2013 3:39 pm

Repository using the QT library

Post by c.hagan » Mon May 13, 2013 2:21 pm


I've been using Ranorex for my application for a number of months, the application uses QT and very few of my controls have meaningful names.

A typical control when first read by ranorex will look something like

"element[@class='QWidget' and @instance='1']/element[@class='QWidget' and @instance='0']/element/element[@class='QWidget' and @instance='0']....etc"

I've found this 'instance' variable to be somewhat unrealiable and changes relatively often obviously any change will cause my repository to be pretty useless, I've favoured 'childindex' recently but with a change to how the development team make use of the qt library this 'childindex' variable has also changed in a recent build and therefore isn't very reliable.

Currently to make my controls work they look something like :-


Essentially i'm relying on the accessible description or name of the final object every time, which seems to work ok for me but i'd like a more reliable means to reference my objects, can someone explain from the ranorex side why these instance or childindex variables might change?

User avatar
Support Team
Site Admin
Site Admin
Posts: 12169
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA

Re: Repository using the QT library

Post by Support Team » Wed May 15, 2013 3:26 pm


If your developers add or delete some elements (e.g. in a TreeView) in your application, the instances are no longer the same. Ranorex just recognizes the elements from the application and creates a list depending on its elements. Each list entry will get an instance number and if the application is not changed, the index should be the same every time you run the test.
If the index changes every time if the developers make some changes, I would suggest to use other properties in the path in order to find the elements.
Please let me know if I didn't understand your question correctly.