on-internet
← Community

Why is searching by Class Chain in iOS faster than XPath?

Stack Overflow ·

I am working on an Appium project to automate an app using Python in both iOS and Android. I usually stick with using XPath to search for elements but in iOS, there is a wonderful searching mechanism called Class Chain, which allows you to search by element's class, such as XCUIElementTypeStaticText for XCUITest. So I was comparing the performance of searching by XPath and Class Chain, to which I found out that Class Chain performance is much faster than XPath, up to 7 times faster. A search that takes XPath 7 seconds can be done in just 1 second using Class Chain. Example: A simple search for

Comments

Sign in or sign up to comment and upvote.

No comments yet.