During interaction with third parity component, I have an issue.
Component change itself regularly, and gets cached.
So Appium gives me old cached version of component.
The same does adb exec-out uiautomator dump
As I understand the reason is not in Appium, but in Android AccessibilityCache.java and AccessibilityInteractionClient.java
I actively search how to clear this cache manually.
I found such a code in your project file:
appium-uiautomator2-server/app/src/main/java/io/appium/uiautomator2/utils/AXWindowHelpers.java
/**
* Clears the in-process Accessibility cache, removing any stale references. Because the
* AccessibilityInteractionClient singleton stores copies of AccessibilityNodeInfo instances,
* calls to public APIs such as `recycle` do not guarantee cached references get updated. See
* the android.view.accessibility AIC and ANI source code for more information.
*/
private static void clearAccessibilityCache() {
try {
// This call invokes `AccessibilityInteractionClient.getInstance().clearCache();` method
UiAutomatorBridge.getInstance().getUiAutomation().setServiceInfo(null);
} catch (NullPointerException npe) {
// it is fine
// ignore
} catch (Exception e) {
Logger.warn("Failed to clear Accessibility Node cache", e);
}
}
Please, help me to understand why it is there, and can I use it somehow to clear AccessibilityCache using appium-uiautomator2
Many thanks.
During interaction with third parity component, I have an issue.
Component change itself regularly, and gets cached.
So Appium gives me old cached version of component.
The same does adb exec-out uiautomator dump
As I understand the reason is not in Appium, but in Android AccessibilityCache.java and AccessibilityInteractionClient.java
I actively search how to clear this cache manually.
I found such a code in your project file:
appium-uiautomator2-server/app/src/main/java/io/appium/uiautomator2/utils/AXWindowHelpers.java
Please, help me to understand why it is there, and can I use it somehow to clear AccessibilityCache using appium-uiautomator2
Many thanks.