Page 1 of 1

Repository using the QT library

Posted: Mon May 13, 2013 2:21 pm
by c.hagan
Hey,

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 :-

/form[@processname='$%*£$']/element[@class='QWidget']/element[@class='QWidget']/element/element[@class='QWidget']/element[@class='QWidget']/element[@class='QWidget']/element[@class='QWidget']/element/element[@class='QWidget']/element[@class='QWidget']/button[@accessibledescription='Finish']


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?

Re: Repository using the QT library

Posted: Wed May 15, 2013 3:26 pm
by Support Team
Hello,

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.

Regards,
Bernhard