wxWidgets controls not correctly recognized

Ranorex Studio, Spy, Recorder, and Driver.
batabek
Posts: 4
Joined: Fri Jun 21, 2013 11:49 am

wxWidgets controls not correctly recognized

Post by batabek » Fri Jun 21, 2013 12:02 pm

I'm trying the Recorder on a wxWidgets application(written in C++) which has mostly grid(table) and tree based controls. If I inspect the grid controls's RanoreXPath values within the Spy, I see some negative values like @controlid="-3340". First are these normal ? Secondly after replaying the recorded test cases, reports always fail while searching the related table entry.(I am just clicking on one of the table entries in the program but Recorder is unable to locate the clicked cell entry). I also checked the table's cell path values after and before recordings and find out their control ids are changing everytime. What is the problem here ? any ideas are welcomed.

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: wxWidgets controls not correctly recognized

Post by krstcs » Fri Jun 21, 2013 1:30 pm

Most likely, the controlid is set to a HEX value of "0xFFFFFFFFFFFFF2F4". This would be a negative value in a signed integer situation, so it shouldn't be a problem.

It would appear that your table cells are being created at run-time and therefore the ID is not static. You probably need to reference the cells by their indexes (column,row) instead of an id.
Shortcuts usually aren't...

batabek
Posts: 4
Joined: Fri Jun 21, 2013 11:49 am

Re: wxWidgets controls not correctly recognized

Post by batabek » Tue Jul 02, 2013 7:26 am

ok I tried to select them using column indices but it fails again.The problem here is the dynamic control ids assigned to some elements which causes to test failure. When I inspect the path value of the cells, I see that control ids are all changing all the times whenever I open the selection dialog (They are in the form of /element[controlid=-"4284"]/element[@controlid="-4285"] ...... ). Is there an alternative way for selection ?

krstcs
Posts: 2683
Joined: Tue Feb 07, 2012 4:14 pm
Location: Austin, Texas, USA

Re: wxWidgets controls not correctly recognized

Post by krstcs » Tue Jul 02, 2013 1:35 pm

As I said, it looks like the ids are being created at runtime, which means they will not be reliable.

I would talk to your developers and explain the situation to them, they may be able to add unique ids to the objects.

Also, you may need to change the path weighting so Ranorex does not look for those ids.

See this blog post for more info: http://www.ranorex.com/blog/automated-t ... ynamic-ids

You should also use Spy to look at the objects and see if there are any attributes that do not change that you can use instead of the dynamic ids.
Shortcuts usually aren't...