I've seen locations change a lot with Angular webpages, so I understand what you mean. IDs can be generated anew every time the page loads and may change depending on the order in which you click on elements. Worse, they can affect dom- and xpath-based locators as well. The short answer to your question is no, it doesn't exist within standard Selenium, Selenium2, ExtendedSelenium2, or any other standard library.
The medium answer to your question is solved in my currently-most-advanced Click Element by Text
custom keyword. It generates an xpath based on your inputs and if it can be found with a simple text search with no extra parameters, it'll do it. It is testy at times and may require argument injections to work, but in general it works very well and is easy to use when xpaths are remotely possible.
Click Element by Text
# EXAMPLE USAGE
# Click Element by Text "text on the element" id="midlevellocationoftext" button
# NOTE: Does not account for extra spaces at the beginning or end, text must be exact
# NOTE: Allows for injections on purpose to allow user to be more exact with their location
[Arguments] ${text} ${location}=* ${elementtype}=*
Click Element xpath=//*[@${location}]//${elementtype}[text()=${text}]
The long answer is that I'm working on something better. Here's what I know so far. The elements to do this do exist out there in the void. JavaScript can turn a webpage into a list of elements. I can call .innerHTML
on those elements to get their text. I haven't worked out the details, but I honestly think it's possible and when I get it figured out, the code will be on Code Review for others to see.