Changed Xpaths after migrating to Appium 1.7.2-beta

Hi team,

We were so far using appium 1.4 and were using the approach of xpaths to select an element.
Since we migrated to latest Appium, all the xpaths have changed.

Is there a way to avoid this so that our existing scripts can work without changing xpaths?

Durga Singh

you can roll back to v1.4 or update your xpath’s accordingly

Nope. A ton has changed with Appium since 1.4. You didn’t mention if you were on iOS or Android. But, either way, your only real choice is to just update your locators. Might be a good opportunity to look into using a better locator type also. Especially if you are on iOS.

Just to show how changing the locator type can speed up testing, I had a few xpath locators that were taking 58 seconds to find an element on a very “busy” app page. I changed the xpath locator to a class chain locator, and the same element was found in just under 3 seconds!! That’s locating the same element on a page, going from 58 seconds, to under 3, just by changing the locator type. So for iOS, try avoiding xpath at all cost. Use the new ones in Appium 1.7.x like predicates or class chain. Good luck!

thanks a lot guys… @Brian_Watson Is there a piece of code that you may share for using predicate strings? I am quite new to this approach :frowning:
My code is written using Java and is for iPad.

Here’s a start…

And here too…

Thanks @Brian_Watson :slight_smile: