Object identification for title bar in an application.

Ask general questions here.
manalitatke
Posts: 36
Joined: Mon Jan 16, 2017 3:24 pm

Object identification for title bar in an application.

Post by manalitatke » Thu May 25, 2017 7:06 pm

Hello,

In my solution, i am creating recordings for title bar menu items in my application.

The application runs fine, if the title bar does not change.

However, this title bar also contains the version number of my application Format -( Title bar name - Version number ).

Now, the solution runs fine for testing of this software version of my application.

However, if i happen to update my application to a newer version, the version number changes, and the changed version number is also reflected in the title bar Format- ( Title bar name - Version number (new))

This fails all my recordings which are recording the menu items located on the menu bar.
Eg: File, View, etc.

So if my recording starts a mouse event from selecting file menu in my title bar of my application, the recording fails.

This is because, the ranorex creates object repository for a recording with a particular name associated with the underlying gui.

I also introduced a code module, that can track only the title name and used that for creating recordings.

However, i wanted to explore more feasible options that can help my recordings to be robust and flexible, even if the name or numbers within the title bars change, i am able to implement my file, view menus successfully.


Any help will be appreciated.

Thanks!

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Object identification for title bar in an application.

Post by Support Team » Thu May 25, 2017 9:06 pm

Hello manalitatke,

I don't know if you saw yet, but I responded to your support tickets inquiring about this. I am going to paste my response below for other users. Feel free to reply on here or in email (although email I will see quicker).
There are multiple ways you can handle dynamic content like this but for this situation, I recommend using the ‘Starts With’ (>) matching operator in the RxPath. Using this, Ranorex only looks for the “1132Com - Reader/Programmer (Version” and does not care what is at the end of the attribute value. This should be robust enough to match your desired form and not require modification every new version.
1.png
1.png (10.25 KiB) Viewed 348 times
Sample Path:

Code: Select all

/form[@title>'1132Com - Reader/Programmer (Version ']
Cheers,
Ned
.
Image