List items in Excel 2003 combobox

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

List items in Excel 2003 combobox

Post by WajdaW » Tue Apr 26, 2011 2:02 pm

I cannot detect listitems in Excel's combobox. I'm talking about Font combobox with Arial, Courier, Times New Roman list items... I always get same RxPath for all list items with Ranorex spy.
In Excel 2007 this works normal (every list item has unique RxPath).
Do you know how to solve this problem?

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: List items in Excel 2003 combobox

Post by Support Team » Wed Apr 27, 2011 9:39 am

Hi,
WajdaW wrote:Do you know how to solve this problem?
These two apps are completely different and therefore you have the difference in the object recognition. Have you tried to use the GDI Plug-In to automate Excel 2003. I think with this plug-in you should be able to get the elements of the toolbar.

Regards,
Peter
Ranorex Team
.
Image

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

Re: List items in Excel 2003 combobox

Post by WajdaW » Thu Apr 28, 2011 10:39 am

Thanks Roland, I didn't know about this plug in. I added EXCEL processname to GDI capture list from context menu and now our combobox list can be found and our problem is solved.
Interesting, font combobox list (arial, courier, verdana, etc..) still cannot be found.

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

Re: List items in Excel 2003 combobox

Post by Support Team » Thu Apr 28, 2011 11:28 am

Hi,

Please could you post us a Ranorex Snapshot of Excel 2003?
How to create a Ranorex Snapshot

Regards,
Peter
Ranorex Team
.
Image

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

Re: List items in Excel 2003 combobox

Post by WajdaW » Mon May 02, 2011 12:15 pm


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

Re: List items in Excel 2003 combobox

Post by Support Team » Mon May 02, 2011 1:08 pm

Hi,

According to your snapshot the RxPath for the Font Combo Box is
/form[@processname='EXCEL']/element[@class='EXCEL2' and @instance='0']/container[@caption='Formatting']/toolbar/combobox[@accessiblename='Font:']
Please open spy and try this RxPath.

Regards,
Peter
Ranorex Team
.
Image

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

Re: List items in Excel 2003 combobox

Post by WajdaW » Mon May 02, 2011 3:36 pm

Thanks, it works. :)
But now I have another problem. I managed to identify our comboboxes by Raw Tex plugin, but we have situation where depending on Office language (English or Deutsch) our combobox items have different names.
For example: List item have either Accept or Akzeptieren rawtext attribute value depending on language.
We want to have the same paths for any language.
For example: List item should have path like this someElement[@ID='someID'] and to be language independent.
Is there a way to identify those items by some ID or some other way in order to use same paths for any language?

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

Re: List items in Excel 2003 combobox

Post by Support Team » Mon May 02, 2011 4:55 pm

Hello Vladimir,

Have a look at the attributes available for the combobox item. If there are others available to identify the element then you can try those. Else consider using variables:

In the Ranorex Studio 3.0 Repository you can use the path editor and replace a value by a variable.
In the test suite at the test case line with the recording using this repository you can provide the actual language specific name.

If do manual coding then you can concatenate the path in your code using the language specific value.

Regards,
Roland
Ranorex Support Team
.
Image

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

Re: List items in Excel 2003 combobox

Post by WajdaW » Fri May 06, 2011 10:36 am

Is there a way to use RxPath variables with code generation?
For example: I have some path with variable in it, and I want to generate C# code and to have this element to be assessed not as property, but as a method with parameter where this parameter is actually RxPath variable.
Path:
body/div[@id='isc_0']/div/div[@id='isc_2']/div[@id='isc_3']/table/tbody/tr/td[@innertext=$presentation]

And I want to access it like this: SomeRxRepo.Instance.PresentationElement("my value").Click();
not like this: SomeRxRepo.Instance.Presentation.Click();

I couldn't manage this.
Is there a way to provide such functionality with code generation or I just need to do this manually?

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

Re: List items in Excel 2003 combobox

Post by Support Team » Fri May 06, 2011 11:31 am

Hi,

have a look at following chapter in our user guide which will explain exactly how to use variables within code modules:
http://www.ranorex.com/support/user-gui ... html#c3112

Kind regards,
Tobias
Support Team
.
Image