how to click all the children in one node?

Class library usage, coding and language questions.
alexbi
Posts: 5
Joined: Mon Aug 12, 2013 3:59 pm

how to click all the children in one node?

Post by alexbi » Mon Aug 12, 2013 4:07 pm

Hi,
currently we are trying to use Ranorex to do multi-language testing, and here is the problem i am facing

in english the button is call "Schedule"
in Spanish the button is call "Programar"

there are no id available for this button.
but this button has a parent node which is call "TabBar"

so what i am trying to do is create an object TabBar, and click on the second child of TabBar, but i haven't have much luck. here are my code

IList<Ranorex.Button> buttonList = repo.root.DashBoard.ShareDashboardOpp.TabBarInfo.CreateAdapters<Ranorex.Button>();
        	int i = buttonList.Count;
        	Console.Out.WriteLine(i);
        	foreach(Ranorex.Button button in buttonList){
        		button.Click();
        	}

mzperix
Posts: 137
Joined: Fri Apr 06, 2012 12:19 pm

Re: how to click all the children in one node?

Post by mzperix » Wed Aug 14, 2013 4:08 pm

You can alter the rxpath of the button to simply click on the second button of the TabBar:

like: ranorexPath Of TabBar/button[2]

Of course this assumes that the order of the buttons are not changing.

alexbi
Posts: 5
Joined: Mon Aug 12, 2013 3:59 pm

Re: how to click all the children in one node?

Post by alexbi » Thu Aug 15, 2013 3:15 pm

what about the method .children?

repo.root.DashBoard.ShareDashboardOpp.TabBar.children

what will this return? a linked list? array?
can anyone give me an example how to utilize this method?

Thanks
Alex

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

Re: how to click all the children in one node?

Post by krstcs » Thu Aug 15, 2013 3:44 pm

Shortcuts usually aren't...

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

Re: how to click all the children in one node?

Post by Support Team » Fri Aug 16, 2013 5:58 pm

Hi,

In order to handle multi-language testing you could use the "or" statement in the RxPath of the specific repository item or you could use a repository variable which can be set to a language-specific value by using the data driven approach.
For more information please see the following links:
RanoreXPath, Lesson 3: Data-Driven Testing, RanoreXPath – Tips and Tricks.

Regards,
Markus
.
Image