Attribute ChildIndex

Ask general questions here.
SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Attribute ChildIndex

Post by SanMan » Mon Apr 19, 2010 7:51 am

Newby question:

I want to find a menuitem on my list. It is always on place 2 (Childindex1).

Now the finding is based on @accessiblename, but I am changing the language all the time, so I would allways like to click the second item no matter what the text is (Settings...Einstellungen...)

Properties of ChildIndex is greyed; it cannot be used?

Or how shoud I modify the path: contextmenu/menuitem[@childindex='1'] -> this one does not work

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Attribute ChildIndex

Post by Support Team » Mon Apr 19, 2010 8:39 am

Hi!

You can use the RxPath like an Array. But the array of Ranorex starts at "1" instead of the arrayindex in C#.
For example:
//Ranorex identify the third menuitem of the contextmenu
RxPath rxPath = "contextmenu/menuitem[3]"
Regards,
Peter
Ranorex Support Team

SanMan
Posts: 210
Joined: Tue Apr 13, 2010 9:59 am

Re: Attribute ChildIndex

Post by SanMan » Mon Apr 19, 2010 9:04 am

Thanks a lot! It works :)