It is not necessary that every element can be identified uniquely by using just using id, class OR name .
In that scenario xpath comes into play. For example:
The website of Edureka has courses tab. If you want to identify the courses tab, you will see there is no id, name or class to identify it. In such scenarios you need to use the Xpath so that you can identify the web element uniquely and work on it.
Here, you have the id for navigation bar but you need to identify a different element i.e “course”. So, you can use the “id of navbar” for further locating your course element via Xpath.
Xpath for the Webelement course is :
If you go to your google chrome ,Right click, go to inspect and press CTRL+F and paste this Xpath ,You will see that your element has been identified uniquely.