appium/appium-uiautomator2-server

android uiautomator enableMultiWindows bug?

TesterWa opened this issue · 3 comments

set enableMultiWindows:true,getPagesource Only return root,use adb shell dump Return to page source normally,Whether it is a bug of appium. test application Wechat!

Is it native elements?
The enableMultiWindows returns views from as

private static AccessibilityNodeInfo[] getWindowRoots() {
List<AccessibilityNodeInfo> result = new ArrayList<>();
List<AccessibilityWindowInfo> windows = CustomUiDevice.getInstance()
.getUiAutomation()
.getWindows();
for (AccessibilityWindowInfo window : windows) {
AccessibilityNodeInfo root = window.getRoot();
if (root == null) {
Logger.info(String.format("Skipping null root node for window: %s", window.toString()));
continue;
}
result.add(root);
}
, so it returns only root, then the Android's AccessibilityNodeInfo also can show them.

是原生元素吗? 来自 as的enableMultiWindows返回视图

private static AccessibilityNodeInfo[] getWindowRoots() {
List<AccessibilityNodeInfo> result = new ArrayList<>();
List<AccessibilityWindowInfo> windows = CustomUiDevice.getInstance()
.getUiAutomation()
.getWindows();
for (AccessibilityWindowInfo window : windows) {
AccessibilityNodeInfo root = window.getRoot();
if (root == null) {
Logger.info(String.format("Skipping null root node for window: %s", window.toString()));
continue;
}
result.add(root);
}

, 所以它只返回 root,那么 Android 的 AccessibilityNodeInfo 也可以显示它们。

Yes ! Native element get roots It should be normal, but is there any problem with appium-ui2-server in generating the page source? Although the page source generation failed, you can get elements with Android native uiselector, provided that you call driver.source before calling findelement to empty windows in ui2-server. The cache. In order to return the element normally.