docs/ios_xcuitest.md in appium_lib-9.1.2 vs docs/ios_xcuitest.md in appium_lib-9.1.3

- old
+ new

@@ -4,20 +4,20 @@ - [WebDriverAgent](https://github.com/facebook/WebDriverAgent) - How to migrate XCUITest from UIAutomation - [Migrating your iOS tests from UIAutomation](https://github.com/appium/appium/blob/v1.6.2/docs/en/advanced-concepts/migrating-to-xcuitest.md) ## find elements -- supported elements by find_element is: +- supported elements by find_element are: - [appium-xcuitest-driver](https://github.com/appium/appium-xcuitest-driver/blob/master/lib/commands/find.js#L17) - [WebDriverAgent](https://github.com/facebook/WebDriverAgent/blob/8346199212bffceab24192e81bc0118d65132466/WebDriverAgentLib/Commands/FBFindElementCommands.m#L111) - Mapping - https://github.com/facebook/WebDriverAgent/blob/master/WebDriverAgentLib/Utilities/FBElementTypeTransformer.m#L19 ### with except for XPath #### examples - [button_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/button.rb#L8), [static_text_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/text.rb#L8), [text_field_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/textfield.rb#L10) and [secure_text_field_class](https://github.com/appium/ruby_lib/blob/master/lib/appium_lib/ios/element/textfield.rb#L15) provide class name. - - If `automationName` is `Appium`, then they provide `UIAxxxx` + - If `automationName` is `Appium` or `nil`, then they provide `UIAxxxx` - If `automationName` is `XCUITest`, then they provide `XCUIElementTypexxx` ```ruby find_element(:class, button_class) # Return a element of XCUIElementTypeButton for XCUITest ``` @@ -28,26 +28,31 @@ ```ruby find_element(:accessibility_id, element) # Return a element which has accessibilityIdentifier, `element`. ``` +- `button/s(value)`, `button_exact/buttons_exact`, `text/s(value)`, `text_exact/texts_exact` +```ruby +buttons(value) # Return button elements include `value` as its name attributes. +``` + + ### with XPath - It is better to avoid XPath strategy. - https://github.com/appium/appium/blob/v1.6.2/docs/en/advanced-concepts/migrating-to-xcuitest.md#xpath-locator-strategy - - > Try not to use XPath locators unless there is absolutely no other alternatives. In general, xpath locators might be times slower, than other types of locators like accessibility id, class name and predicate (up to 100 times slower in some special cases). They are so slow, because xpath location is not natively supported by Apple's XCTest framework. + - > Try not to use XPath locators unless there are absolutely no other alternatives. In general, XPath locators might be times slower, than other types of locators like accessibility id, class name and predicate (up to 100 times slower in some special cases). They are so slow because XPath location is not natively supported by Apple's XCTest framework. - Improved performance a bit - https://github.com/appium/appium/issues/6842 - https://github.com/facebook/WebDriverAgent/issues/306 - XPath in WebDriverAgent - https://github.com/facebook/WebDriverAgent/blob/2158a8d0f305549532f1338fe1e4628cfbd53cd9/WebDriverAgentLib/Categories/XCElementSnapshot%2BFBHelpers.m#L57 #### examples -- `button/s(value)`, `textfield/s(value)`, `text/s(value)` uses XPath in their method. So, these methods are slower than other find_element directly. +- `textfield/s(value)`, `find/s`, `find_exact/finds_exact` uses XPath in their method. So, these methods are slower than other find_element directly. ```ruby -button(value) # Return a XCUIElementTypeButton element which has `value` text. textfield(value) # Return a XCUIElementTypeSecureTextField or XCUIElementTypeTextField element which has `value` text. -text(value) # Return a XCUIElementTypeStaticText element which has `value` text. +finds_exact(value) # Return any elements include `value` as its name attributes. ``` ## Other actions -Basically, other actions such as `type` is compatible with `automationName = Appium`. +Basically, other actions such as `type` are compatible with `automationName = Appium`.