Identify element without ID
Posted: Thu Jun 20, 2013 4:54 pm
Hi all!
I have a web-page consisting of multiple elements div[#'blogEntry']. They don't have unique ID's but I need to choose the first and the last elements.
I was able to create a Rxpath to choose the first one (its RxPath is shown on png attached). Though it's exactly the same as the last element's path. When I track the last element with Spy, it finds the path but if I click Enter on this path, then right-click on identified element and choose Highlight element, Spy shows the first one again.
I can see that ChildIndex and ScreenLocation (second argument) change from entry to entry (and for the last blogEntry their values are 62 and 3516 respectively but these numbers will change for another page,they can't be hardcoded) but they're disabled and I can't operate any of those attributes.
Maybe, some regular expressions? functions like last()? I couldn't find anything useful in http://www.ranorex.com/support/user-gui ... xpath.html though this page helps a lot in other cases.
Please, help me to create unique paths for both cases.
Thanks,
Alena.
I have a web-page consisting of multiple elements div[#'blogEntry']. They don't have unique ID's but I need to choose the first and the last elements.
I was able to create a Rxpath to choose the first one (its RxPath is shown on png attached). Though it's exactly the same as the last element's path. When I track the last element with Spy, it finds the path but if I click Enter on this path, then right-click on identified element and choose Highlight element, Spy shows the first one again.
I can see that ChildIndex and ScreenLocation (second argument) change from entry to entry (and for the last blogEntry their values are 62 and 3516 respectively but these numbers will change for another page,they can't be hardcoded) but they're disabled and I can't operate any of those attributes.
Maybe, some regular expressions? functions like last()? I couldn't find anything useful in http://www.ranorex.com/support/user-gui ... xpath.html though this page helps a lot in other cases.
Please, help me to create unique paths for both cases.
Thanks,
Alena.