I am using relative path.As from iOS <9.3,apple uses uiAutomator to find the elements where as in ios>9.3 it uses XCUITest to find the elements.Becuase of that the element name changes to XUITYPEButton.This is effecting the xpath.
Please read the below documentation.
With XCUITest, Apple has given different class names to the UI elements which make up the view hierarchy. For example, UIAButton is now XCUIElementTypeButton. In many cases, there is a direct mapping between these two classes. If you use the class name locator strategy to find elements, Appium 1.6 will rewrite the selector for you. Likewise, if you use the xpath locator strategy, Appium 1.6 will find any UIA* elements in your XPath string and rewrite them appropriately.
This does not however guarantee that your tests will work exactly the same, for two reasons:
The application hierarchy reported to Appium will not necessarily be identical within XCUITest to what it was within UIAutomation. If you have a path-based XPath selector, it may need to be adjusted.
The list of class names is not entirely identical either. Many elements are returned by XCUITest as belonging to the XCUIElementTypeOther class, a sort of catch-all container.
I just wanted to know is there any way to handle this compatibility problem.