How to migrate ios9 testcases to work with iOS10

As from iOS 9 to 10 ,apple moved from ui automator to XCUITest.
Is there any way can we run the exisiting testcases which are running successfully on iOS<9.3 to run on iOS10.

Any help on this is highly regarded.

Yes you can execute your existing Testcase on ios10 .just you need to do new setup for XCUItest in your mac.

Thanks for the reply.I set up XCUI test on mac and able to automate testcases on iOS10.
But the problem is if I want to use the same testcases which are running on iOS9 to run it on iOS10,I have to do lot of changes like changing xpath and class names.
Is there any way can it automatically does all the changes like i am looking some thing like backward compatability.
For example if I automate the testcases on iOS10,I am excepting it should run automatically on iOS9.

I understood your problem but migrate from ios9 to ios10 xpath shouldn’t changed may be in your new build dev made changes in property, check with your dev once. Or we have to understand how you are writing xpath use always relative xpath.

Note:- i never faced in xpath changes in migration. my scripts are smoothly running in any ios device (iphone,ipad) with ios version (10.3,9.3).

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.