Need help creating XPATH selectors which depends on the name of the element
I wonder if someone can help me. I have an application where user single click on folder icons to open/close it (Similar to how we navigate/explore files in windows explorer tree) - When I am recording my test in selenium IDE here is code that's generated:
Here is a snippet of source code from the application corresponding to the collapsed state of the folders.
The problem with the current default element xpath locator is that if few months down the line we introduce another folder on the tree it may shift the folder position up or down the tree, which would result in wrong folder being opened. Therefore can someone please help my put together an XPath which would be more robust and would not depend on the exact location of folder in the tree but rather the name of the folder which is unique?