Skip to content
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

android uiautomator enableMultiWindows bug? #500

Open
TesterWa opened this issue Jan 10, 2023 · 3 comments
Open

android uiautomator enableMultiWindows bug? #500

TesterWa opened this issue Jan 10, 2023 · 3 comments

Comments

@TesterWa
Copy link

TesterWa commented Jan 10, 2023

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!

@KazuCocoa
Copy link
Member

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.

@TesterWa
Copy link
Author

是原生元素吗? 来自 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.

@KazuCocoa
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants