Identifying ribbon buttons in excel

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Identifying ribbon buttons in excel

Post by WajdaW » Wed Sep 05, 2012 1:30 pm

I am developing some addin from Office using Addin Express. I just wonder if there is a way to assign some kind of id to my components so I can identify them uniquely?
I found property Id on those buttons, but it seems that Ranorex cannot recognize it. I used earlier AccessibleName attribute, but it seems that this attribute is changing when I change text of button. I'm testing my addin on two machines (with English and with German) so localization differs and hence Ranorex paths.

What I was able to do is to locate buttons based on their index in container, that gives me language independence, but every time layout is changed I'll need to update paths. I would like to make it place independent too.

Any suggestions?

Best regards,
Vladimir Vajda

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

Re: Identifying ribbon buttons in excel

Post by Support Team » Thu Sep 06, 2012 2:42 pm

Hello,

Unfortunately we have no experiences with Addin Express, but the identification of the elements depends on the technology which is used, so it would be helpful if you could send us a Ranorex snapshot file and more detailed information about the technology which is used? The following link shows how to create a snapshot file:Creating Ranorex Snapshot Files

Regards,
Bernhard
Ranorex Support Team
.
Image

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: Identifying ribbon buttons in excel

Post by WajdaW » Mon Sep 10, 2012 10:23 am

Here is snapshot.

Here are some documentation about technology used:
http://www.add-in-express.com/files/docs/adxnet7.pdf

It is basically, an Excel COM add-in.
Attachments
Ribbon snapshot.rxsnp
(92.23 KiB) Downloaded 211 times

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

Re: Identifying ribbon buttons in excel

Post by Support Team » Wed Sep 12, 2012 8:35 am

Hello,

Thanks for the snapshot!
Did you already try to use regular expressions in your RxPath or a logic OR in order to identify the elements in German and English?
Here is a sample: button[@accessiblename='Synchronize' or @accessiblename='Synchronisieren']
and here is a link to the UserGuide section about the RxPath, if think this page is very informative: RanoreXPath.
Is this a solution for you?

Regards,
Markus
Ranorex Support Team
.
Image

WajdaW
Posts: 75
Joined: Wed Jan 05, 2011 6:45 pm

Re: Identifying ribbon buttons in excel

Post by WajdaW » Tue Oct 02, 2012 2:02 pm

Sorry for late reply, I have postponed this task as I have some other which have higher priority.
Yes I know about this option. But generally, our names could change. Let say, in one version title can be "Synchronize", in other "Synchronization", or we decide to support one more language and to test it on one more machine with that particular language and so on. I was wondering if I could make it maybe more independent on title, use some id I've embedded in code. If there is no option, I'll need to do it as you have proposed, with or operator.

Regards,
Vladimir

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

Re: Identifying ribbon buttons in excel

Post by Support Team » Wed Oct 03, 2012 1:23 pm

Hi,

No problem.
Does the "accessibledescription" attribute also change or would the childindex be a valid attribute for you?
For the sync button: /form[@processname='EXCEL']/element/container/element/element/container/container/container/container/toolbar[@accessiblename='Fact Operations']/button[@childindex='0'].

Regards,
Markus
Ranorex Support Team
.
Image