Hey Lakshya, you can locate an element by partially comparing its attributes in XPath, as XPath supports the contains() method. It allows partial matching of attribute’s value and thus helps when the attributes use dynamic values while having some fixed part. See the below example to understand better:
xPath usage => //*[contains(@section, 'mobiles')]
The above expression would match all values of section attribute having the word ‘mobiles’ in them.