Page 1 of 1

How to get latest index of tabpage or ignore it

Posted: Thu Feb 25, 2016 12:54 pm
by oli3
Hello all

I'm trying to figure out how to not have to use the code "tabpage[@index='1']" for an element in my repository.

Is there a way to instead of having to use index=1 to use the latest index of the tabpages? Or is there a way to entirely wildcard that piece of code?

I've tried with "?" but that didn't work. I also tried with entirely removing that piece of code and leaving just "//" but also that didn't work during playback.

Code: Select all

container[2]//tabpage[@index='1']/element/container/container/container[1]//container[@automationid='LayoutRoot']/?/?/tabpage[@automationid='General']/container[1]/.......
I'm using Ranorex 5.4.5

Thanks

Re: How to get latest index of tabpage or ignore it

Posted: Fri Feb 26, 2016 9:06 am
by odklizec
Hi,

You can use function last()='True' in your xpath, like this:

Code: Select all

container[2]//tabpage[last()='True']/element/container/container/container[1]//container[@automationid='LayoutRoot']/?/?/tabpage[@automationid='General']/container[1]/.......
For more details about available xpath functions, check this user guide page:
http://www.ranorex.com/support/user-gui ... xpath.html

Hope this helps?

Re: How to get latest index of tabpage or ignore it

Posted: Mon Feb 29, 2016 10:17 am
by oli3
Thanks!