SyntaxFix
Write A Post
Hire A Developer
Questions
You can use ancestor. I find that this is easier to read because the element you are actually selecting is at the end of the path.
ancestor
//span[contains(text(),'someText')]/ancestor::div[contains(@class, 'measure-tab')]