Page 1 of 1

how to click all the children in one node?

Posted: Mon Aug 12, 2013 4:07 pm
by alexbi
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();
        	}

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

Posted: Wed Aug 14, 2013 4:08 pm
by mzperix
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.

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

Posted: Thu Aug 15, 2013 3:15 pm
by alexbi
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

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

Posted: Thu Aug 15, 2013 3:44 pm
by krstcs

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

Posted: Fri Aug 16, 2013 5:58 pm
by Support Team
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