Page 1 of 1

get the nth attribute

Posted: Tue Feb 12, 2019 9:05 am
by rsudhak
hi ,

I have a list of menu, say L1,L2,L3...Ln , similarly I have a list of sub -menu say K2,L2,M2... . sub menu is a context menu pop up box. I have 3 questions here
1. how do I get the element xpath easily, please note that I am new to Ranorex, I want something similar to Actions class in selenium, where I can click on the menu and then move to the sub menu. (spy doesnt help here :( and cntrl plus windows crashes spy)
2.In the scenario you see that L2 is in the menu as well as submenu, When I run the test on its own it passes, but when run as a suite it fails and always click the L2 from the the menu instead of the sub menu. whats the best way to differentiate the two elements.
3. Also , is there a way to select the nth attribute eg . I can select the menu item with //menuitem[@name='L2'], I want to select the submenu by giving the nth attribute eg something like //menuitem[@name='L2][2], so that it clicks on 2nd element with the attribute i.e the submenu

Thanks

Re: get the nth attribute

Posted: Tue Feb 12, 2019 9:14 am
by odklizec
Hi,

There is no point in creating duplicated posts. Please check my answer in your original post:
get-the-nth-attribute-t13445.html#p52822