-
-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add the description of setting API snapshotMaxDepth #629
feat: add the description of setting API snapshotMaxDepth #629
Conversation
README.md
Outdated
@@ -289,6 +289,7 @@ enforceXPath1 | boolean | Since UiAutomator2 driver version `4.25.0` XPath2 is s | |||
limitXPathContextScope | boolean | Due to historical reasons UiAutomator2 driver limits scopes of element context-based searches to the parent element. This means a request like `findElement(By.xpath, "//root").findElement(By.xpath, "./..")` would always fail, because the driver only collects descendants of the `root` element for the destination XML source. The `limitXPathContextScope` setting being set to `false` changes that default behavior, so the collected page source includes the whole page source XML where `root` node is set as the search context. With that setting disabled the search query above should not fail anymore. Although, you must still be careful while building XPath requests for context-based searches with the `limitXPathContextScope` setting set to `false`. A request like `findElement(By.xpath, "//root").findElement(By.xpath, "//element")` would ignore the current context and search for `element` trough the whole page source. Use `.` notation to correct that behavior and only find `element` nodes which are descendants of the `root` node: `findElement(By.xpath, "//root").findElement(By.xpath, ".//element")`. | |||
disableIdLocatorAutocompletion | boolean | According to internal Android standards it is expected that each resource identifier is prefixed with `<packageName>:id/` string. This should guarantee uniqueness of each identifier. Although some application development frameworks ignore this rule and don't add such prefix automatically or, rather, let it up to the developer to decide how to represent their application identifiers. For example, [testTag modifier attribute in the Jetpack Compose](https://developer.android.com/reference/kotlin/androidx/compose/ui/platform/package-summary#(androidx.compose.ui.Modifier).testTag(kotlin.String)) with [testTagsAsResourceId](https://developer.android.com/reference/kotlin/androidx/compose/ui/semantics/package-summary#(androidx.compose.ui.semantics.SemanticsPropertyReceiver).testTagsAsResourceId()) allows developers to set an arbitrary string without the prefix rule. [Interoperability with UiAutomator](https://developer.android.com/jetpack/compose/testing) also explains how to set it. By default UIA2 driver adds the above prefixes automatically to all resource id locators if they are not prefixed, but in case of such "special" apps this feature might be disabled by assigning the setting to `true`. | |||
includeExtrasInPageSource | boolean | Whether to include `extras` element attribute in the XML page source result. Then, XPath locator can find the element by the extras. Its value consists of combined [getExtras](https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo#getExtras()) as `keys=value` pair separated by a semicolon (`;`), thus you may need to find the element with partial matching like `contains` e.g. `driver.find_element :xpath, '//*[contains(@extras, "AccessibilityNodeInfo.roleDescription=")]'`. The value could be huge if elements in the XML page source have large `extras`. It could affect the performance of XML page source generation. | |||
snapshotMaxDepth | int | The number of maximum depth for snapshot. The default value is `70`. This number should be in range [1, 500]. A part of elements source tree might be lost if the value was small. Also, StackOverflow might be caused if the value was large (Issues [1](https://github.com/appium/appium/issues/12545), [2](https://github.com/appium/appium/issues/12892)). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you address the available driver version? The version will be 2.27.0
as feat
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your review!
I have a question. I added a setting API snapshotMaxDepth
in appium-uiautomator2-server. I think a setting API does not depend on the driver version, I'm sorry if I misunderstand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct for the UIA2 server, but users use UIA2 driver to manage UIA2 server as well. It means users who install a new pushed driver version with 5.12.0
UIA2 server version can use this snapshotMaxDepth
. So to expose this snapshotMaxDepth
for users via UIA2 server, they need a new UIA2 driver pushed by this PR merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I added the available version and updated some commented points. c5f5525
## [2.27.0](v2.26.3...v2.27.0) (2023-06-21) ### Features * add the description of setting API snapshotMaxDepth ([#629](#629)) ([c74ad63](c74ad63))
🎉 This PR is included in version 2.27.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Add the description of setting API snapshotMaxDepth.
Based on appium/appium-uiautomator2-server#517 (comment)