Does the Xpath change if the content inside the XPath changes?
I.e. the website changes the text in the XPath from 'supports' to 'support'. Would the XPath change even if the text change or will it stay the same?
See, it's bad practice to have xpath with harcoded text, cause if you are viewing website in English then xpath (let's say) //div[text()='support'] represent at least one node in DOM, where as if same website in other countries (let's say German ) have some different text for support, right ? so your automation scripts will fail due to not having a common xpath locator.
Having said that, xpath is least preferable over ID, class name, tag name, css selector, link text, partial link text, and if none of them are working obviously you will have to use xpath. Also xpath comes handy if you wanna move upward in DOM.
Does an XPath change if the content inside it changes?