When using Selenium, I often use driver.find_element(By.XPATH, ) rather than driver.find_element(By.CSS_SELECTOR, ). I find it easy to copy the XPATH rather than understanding the HTML structure of the website.
But I had a little problem. Recently I noticed that most of my scripts using XPATH don't work because the XPATHtends to change. Is their a way to fix this problem? And is there a difference between xpath and full xpath?
You have to learn how to create correct locators.
Automatically generated XPath or CSS Selector locators are extremely fragile. This is making them almost useless.
Again, both automatically created XPath and CSS Selector locators.
Creating good locators will make your code much more stable but still, any Selenium based code needs maintenance after changes involved by FrontEnd developers since they are changing the page structure and elements on the page.
As about XPaths, generally there are relative and absolute XPaths.
Absolute XPath defines a full and the explicit path from the page top to the specific element node.
While relative XPath defines some short unique locator for some element node.
XPATHs tend to change with time, making finding elements by XPATH not useful