@appium/mcp-documentation 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +3 -6
- package/src/resources/submodules/appium/.github/PULL_REQUEST_TEMPLATE.md +28 -0
- package/src/resources/submodules/appium/.github/copilot-instructions.md +9 -0
- package/src/resources/submodules/appium/CHANGELOG.md +45 -0
- package/src/resources/submodules/appium/GOVERNANCE.md +189 -0
- package/src/resources/submodules/appium/README.md +221 -0
- package/src/resources/submodules/appium/ROADMAP.md +30 -0
- package/src/resources/submodules/appium/SPONSORS.md +3 -0
- package/src/resources/submodules/appium/docs/README.md +6 -0
- package/src/resources/submodules/appium/docs/payout.md +35 -0
- package/src/resources/submodules/appium/packages/appium/CHANGELOG.md +1547 -0
- package/src/resources/submodules/appium/packages/appium/README.md +221 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/index.md +2 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-appiumconf2024.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-headspin-as-development-partner.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-lambdatest-as-development-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-lambdatest-as-strategic-partner.md +42 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/announcing-sponsorship-program.md +48 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/appium3.md +40 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/blog/posts/hello-world.md +15 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/contributing/index.md +150 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-docs.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-doctor-checks.md +141 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-drivers.md +1002 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/build-plugins.md +523 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/config-system.md +451 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/index.md +18 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/developing/sensitive.md +49 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/clients.md +132 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/drivers.md +207 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/index.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/plugins.md +138 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/ecosystem/tools.md +106 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/branch-testing.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/caching.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/caps.md +271 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/config.md +98 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/context.md +44 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/event-timing.md +73 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/execute-methods.md +122 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/grid.md +178 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/headers.md +17 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/log-filters.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/managing-exts.md +87 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/migrating-1-to-2.md +368 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/migrating-2-to-3.md +464 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/security.md +87 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/settings.md +68 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/guides/tls.md +42 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/index.md +59 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/appium.md +202 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/clients.md +127 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/drivers.md +188 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/history.md +196 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/intro/index.md +39 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/index.md +29 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/install.md +50 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/next-steps.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/requirements.md +29 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-dotnet.md +105 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-java.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-js.md +75 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-py.md +60 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/test-rb.md +83 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/quickstart/uiauto2-driver.md +144 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/appium.md +394 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/bidi.md +70 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/index.md +30 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/jsonwp.md +214 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/mjsonwp.md +151 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/others.md +736 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/plugins.md +289 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/api/webdriver.md +1114 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/env-vars.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/extensions.md +246 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/index.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/insecure-features.md +24 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/server.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/cli/setup.md +76 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/index.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/session/caps.md +56 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/reference/session/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/resources/index.md +28 -0
- package/src/resources/submodules/appium/packages/appium/docs/en/sponsors/index.md +69 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/index.md +2 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-appiumconf2024.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-headspin-as-development-partner.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-lambdatest-as-development-partner.md +34 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-lambdatest-as-strategic-partner.md +41 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/announcing-sponsorship-program.md +48 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/appium3.md +40 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/blog/posts/hello-world.md +15 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/contributing/index.md +158 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-docs.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-doctor-checks.md +141 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-drivers.md +1010 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/build-plugins.md +529 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/config-system.md +468 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/index.md +18 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/developing/sensitive.md +49 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/clients.md +143 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/drivers.md +219 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/index.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/plugins.md +140 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/ecosystem/tools.md +115 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/branch-testing.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/caching.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/caps.md +276 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/config.md +102 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/context.md +44 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/event-timing.md +75 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/execute-methods.md +142 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/grid.md +178 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/headers.md +17 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/log-filters.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/managing-exts.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/migrating-1-to-2.md +402 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/migrating-2-to-3.md +458 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/security.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/settings.md +70 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/guides/tls.md +43 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/index.md +55 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/appium.md +191 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/clients.md +139 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/drivers.md +188 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/history.md +196 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/intro/index.md +39 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/install.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/next-steps.md +19 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/requirements.md +29 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-dotnet.md +107 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-java.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-js.md +77 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-py.md +63 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/test-rb.md +85 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/quickstart/uiauto2-driver.md +148 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/appium.md +395 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/bidi.md +71 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/index.md +30 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/jsonwp.md +215 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/mjsonwp.md +152 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/others.md +737 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/plugins.md +291 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/api/webdriver.md +1114 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/env-vars.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/extensions.md +247 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/index.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/insecure-features.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/server.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/cli/setup.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/index.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/session/caps.md +56 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/reference/session/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/resources/index.md +28 -0
- package/src/resources/submodules/appium/packages/appium/docs/ja/sponsors/index.md +66 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-horiz-white.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-horiz.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo-white.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/appium-logo.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-dark.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-browserstack-light.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-lambdatest-dark.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-lambdatest-light.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-sauce.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-dark.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/overrides/assets/images/sponsor-logo-testmuai-light.png +0 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/index.md +2 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-appiumconf2024.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-browserstack-as-strategic-partner.md +46 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-headspin-as-development-partner.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-lambdatest-as-development-partner.md +34 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-lambdatest-as-strategic-partner.md +41 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-sauce-labs-as-strategic-partner.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/announcing-sponsorship-program.md +48 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/appium3.md +40 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/blog/posts/hello-world.md +15 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/contributing/index.md +132 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-docs.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-doctor-checks.md +141 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-drivers.md +1010 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/build-plugins.md +529 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/config-system.md +468 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/index.md +18 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/developing/sensitive.md +49 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/clients.md +143 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/drivers.md +219 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/index.md +45 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/plugins.md +140 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/ecosystem/tools.md +115 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/branch-testing.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/caching.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/caps.md +279 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/config.md +102 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/context.md +44 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/event-timing.md +75 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/execute-methods.md +142 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/grid.md +178 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/headers.md +17 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/log-filters.md +86 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/managing-exts.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/migrating-1-to-2.md +410 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/migrating-2-to-3.md +459 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/security.md +89 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/settings.md +70 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/guides/tls.md +43 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/index.md +54 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/appium.md +91 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/clients.md +100 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/drivers.md +101 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/history.md +72 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/intro/index.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/install.md +47 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/next-steps.md +19 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/requirements.md +21 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-dotnet.md +99 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-java.md +20 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-js.md +62 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-py.md +57 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/test-rb.md +80 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/quickstart/uiauto2-driver.md +119 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/appium.md +395 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/bidi.md +71 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/index.md +30 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/jsonwp.md +215 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/mjsonwp.md +152 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/others.md +737 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/plugins.md +291 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/api/webdriver.md +1114 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/env-vars.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/extensions.md +247 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/index.md +36 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/insecure-features.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/server.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/cli/setup.md +78 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/index.md +31 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/session/caps.md +56 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/reference/session/index.md +23 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/resources/index.md +28 -0
- package/src/resources/submodules/appium/packages/appium/docs/zh/sponsors/index.md +66 -0
- package/src/resources/submodules/appium/packages/appium/types/manifest/README.md +30 -0
- package/src/resources/submodules/appium/packages/base-driver/CHANGELOG.md +1244 -0
- package/src/resources/submodules/appium/packages/base-driver/README.md +15 -0
- package/src/resources/submodules/appium/packages/base-driver/docs/mjsonwp/errors.md +82 -0
- package/src/resources/submodules/appium/packages/base-driver/docs/mjsonwp/protocol-methods.md +182 -0
- package/src/resources/submodules/appium/packages/base-driver/static/appium.png +0 -0
- package/src/resources/submodules/appium/packages/base-plugin/CHANGELOG.md +764 -0
- package/src/resources/submodules/appium/packages/base-plugin/README.md +15 -0
- package/src/resources/submodules/appium/packages/docutils/CHANGELOG.md +1038 -0
- package/src/resources/submodules/appium/packages/docutils/README.md +27 -0
- package/src/resources/submodules/appium/packages/driver-test-support/CHANGELOG.md +790 -0
- package/src/resources/submodules/appium/packages/driver-test-support/README.md +103 -0
- package/src/resources/submodules/appium/packages/eslint-config-appium-ts/CHANGELOG.md +256 -0
- package/src/resources/submodules/appium/packages/eslint-config-appium-ts/README.md +47 -0
- package/src/resources/submodules/appium/packages/execute-driver-plugin/CHANGELOG.md +671 -0
- package/src/resources/submodules/appium/packages/execute-driver-plugin/README.md +55 -0
- package/src/resources/submodules/appium/packages/fake-driver/CHANGELOG.md +603 -0
- package/src/resources/submodules/appium/packages/fake-driver/README.md +7 -0
- package/src/resources/submodules/appium/packages/fake-driver/lib/screen.png +0 -0
- package/src/resources/submodules/appium/packages/fake-plugin/CHANGELOG.md +780 -0
- package/src/resources/submodules/appium/packages/fake-plugin/README.md +7 -0
- package/src/resources/submodules/appium/packages/images-plugin/CHANGELOG.md +691 -0
- package/src/resources/submodules/appium/packages/images-plugin/README.md +27 -0
- package/src/resources/submodules/appium/packages/images-plugin/docs/find-by-image.md +65 -0
- package/src/resources/submodules/appium/packages/images-plugin/docs/image-comparison.md +203 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/appstore.png +0 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img1.png +0 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img2.png +0 -0
- package/src/resources/submodules/appium/packages/images-plugin/test/fixtures/img2_part.png +0 -0
- package/src/resources/submodules/appium/packages/logger/CHANGELOG.md +212 -0
- package/src/resources/submodules/appium/packages/logger/README.md +31 -0
- package/src/resources/submodules/appium/packages/opencv/CHANGELOG.md +446 -0
- package/src/resources/submodules/appium/packages/opencv/README.md +68 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/appium-diagram.jpg +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc1.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc2.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/cc_rotated.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/findwaldo.jpg +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/number5.png +0 -0
- package/src/resources/submodules/appium/packages/opencv/test/e2e/images/waldo.jpg +0 -0
- package/src/resources/submodules/appium/packages/plugin-test-support/CHANGELOG.md +610 -0
- package/src/resources/submodules/appium/packages/plugin-test-support/README.md +49 -0
- package/src/resources/submodules/appium/packages/relaxed-caps-plugin/CHANGELOG.md +209 -0
- package/src/resources/submodules/appium/packages/relaxed-caps-plugin/README.md +35 -0
- package/src/resources/submodules/appium/packages/schema/CHANGELOG.md +308 -0
- package/src/resources/submodules/appium/packages/schema/README.md +50 -0
- package/src/resources/submodules/appium/packages/storage-plugin/CHANGELOG.md +157 -0
- package/src/resources/submodules/appium/packages/storage-plugin/README.md +83 -0
- package/src/resources/submodules/appium/packages/strongbox/CHANGELOG.md +129 -0
- package/src/resources/submodules/appium/packages/strongbox/README.md +110 -0
- package/src/resources/submodules/appium/packages/support/CHANGELOG.md +1147 -0
- package/src/resources/submodules/appium/packages/support/README.md +161 -0
- package/src/resources/submodules/appium/packages/tsconfig/CHANGELOG.md +147 -0
- package/src/resources/submodules/appium/packages/tsconfig/README.md +19 -0
- package/src/resources/submodules/appium/packages/types/CHANGELOG.md +871 -0
- package/src/resources/submodules/appium/packages/types/README.md +21 -0
- package/src/resources/submodules/appium/packages/universal-xml-plugin/CHANGELOG.md +502 -0
- package/src/resources/submodules/appium/packages/universal-xml-plugin/README.md +53 -0
- package/src/resources/submodules/appium/renovate/README.md +55 -0
- package/src/resources/submodules/appium-skills/.github/dependabot.yml +11 -0
- package/src/resources/submodules/appium-skills/.github/workflows/pr-title.yml +10 -0
- package/src/resources/submodules/appium-skills/AGENTS.md +214 -0
- package/src/resources/submodules/appium-skills/LICENSE +201 -0
- package/src/resources/submodules/appium-skills/README.md +33 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/SKILL.md +66 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/community-search.md +51 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/uiautomator2-locators.md +34 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/uiautomator2-session-startup.md +53 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/xcuitest-element-lookup.md +23 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/xcuitest-locators.md +16 -0
- package/src/resources/submodules/appium-skills/skills/appium-troubleshooting/references/xcuitest-troubleshooting.md +52 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-android/SKILL.md +346 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-bundletool/SKILL.md +91 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-chromium/SKILL.md +260 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-espresso/SKILL.md +216 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-ffmpeg/SKILL.md +91 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-node/SKILL.md +128 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-uiautomator2/SKILL.md +225 -0
- package/src/resources/submodules/appium-skills/skills/environment-setup-xcuitest/SKILL.md +153 -0
- package/src/resources/submodules/appium-skills/skills/xcuitest-real-device-config/SKILL.md +488 -0
- package/src/resources/submodules/appium-uiautomator2-driver/CHANGELOG.md +1506 -0
- package/src/resources/submodules/appium-uiautomator2-driver/README.md +2253 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/actions.md +72 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/activity-startup.md +47 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/android-appbundle.md +69 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/android-mobile-gestures.md +352 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/android-multiwindow.md +872 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/architecture.md +34 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/bidi.md +50 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/capability-sets.md +136 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/mjpeg.md +111 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/scheduled-actions.md +155 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/uiautomator-uiselector.md +51 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/main.md +95 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/screen1.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/docs/unlock/screen2.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/checkered-squares.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/start-button.png +0 -0
- package/src/resources/submodules/appium-uiautomator2-driver/test/functional/assets/stop-button.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/.github/ISSUE_TEMPLATE.md +4 -0
- package/src/resources/submodules/appium-xcuitest-driver/CHANGELOG.md +3373 -0
- package/src/resources/submodules/appium-xcuitest-driver/README.md +55 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-logo-white.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-logo.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/assets/images/appium-plus-xctest.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/contributing.md +45 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/endpoints-wda.md +61 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/endpoints.md +95 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/device-setup.md +81 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/index.md +36 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/installation.md +38 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/check-prov-prof.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/create-new-project.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/create-single-page.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/no-prov-prof.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/project-prov-prof.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/set-up-bundle.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/untrusted-dev.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-bundle-id.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-config.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-facebook-fail.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/assets/images/xcode-facebook-succeed.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/auto-config.md +54 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/basic-manual-config.md +40 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/full-manual-config.md +49 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/generic-device-config.md +75 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/provisioning-profile/index.md +117 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/getting-started/system-requirements.md +131 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/keynote.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/on_my_iphone.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/assets/images/ios-xctest-file-movement/top_files.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/attach-to-running-wda.md +43 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/audio-capture.md +78 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/biometric-auth.md +29 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/capability-sets.md +169 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/ci-setup.md +47 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/clipboard.md +47 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/file-transfer.md +147 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/gestures.md +55 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/hybrid.md +137 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/input-events.md +67 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/install-certificate.md +20 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/mjpeg.md +98 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/multiple-xcode-versions.md +37 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/parallel-tests.md +39 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/remotexpc-tunnels-real-devices.md +148 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/run-prebuilt-wda.md +147 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/run-preinstalled-wda.md +177 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/tvos.md +246 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/guides/wda-custom-server.md +283 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/index.md +36 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/overview.md +137 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/assets/images/useXctestrunFile.png +0 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/bidi.md +192 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/capabilities.md +164 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/commands.md +468 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/element-attributes.md +157 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/env-vars.md +18 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/execute-methods.md +2269 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/ios-predicate.md +196 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/locator-strategies.md +107 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/scripts.md +555 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/security-flags.md +28 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/server-args.md +19 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/settings.md +467 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/reference/xpath-extensions.md +167 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/troubleshooting/element-lookup.md +202 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/troubleshooting/index.md +204 -0
- package/src/resources/submodules/appium-xcuitest-driver/docs/troubleshooting/wda-slowness.md +206 -0
- package/src/resources/submodules/appium-xcuitest-driver/test/assets/test.png +0 -0
- package/src/resources/submodules.zip +0 -0
|
@@ -0,0 +1,872 @@
|
|
|
1
|
+
# Testing Multi-Window Android Applications
|
|
2
|
+
|
|
3
|
+
This guide explains how to test multi-window Android applications using the UiAutomator2 driver, including how windows, displays, and hardware displays relate to each other, and how various settings affect element location and page source generation.
|
|
4
|
+
|
|
5
|
+
## What Are Multi-Window Android Applications?
|
|
6
|
+
|
|
7
|
+
Multi-window applications are Android applications that can display multiple windows simultaneously on the screen. This includes:
|
|
8
|
+
|
|
9
|
+
- **Split-screen mode**: Two applications running side-by-side
|
|
10
|
+
- **Picture-in-picture (PiP)**: A video player window floating over other content
|
|
11
|
+
- **Freeform windows**: Desktop-like windowed applications (on supported devices)
|
|
12
|
+
- **System windows**: On-screen keyboards, system dialogs, and notification panels
|
|
13
|
+
- **Overlay windows**: Floating action buttons, tooltips, and other overlay UI elements
|
|
14
|
+
|
|
15
|
+
Each window in a multi-window environment has its own view hierarchy and can be interacted with independently. The UiAutomator2 driver provides settings and capabilities to handle these complex scenarios.
|
|
16
|
+
|
|
17
|
+
## Windows, Displays, and Hardware Displays
|
|
18
|
+
|
|
19
|
+
Understanding the relationship between these concepts is crucial for effective multi-window testing:
|
|
20
|
+
|
|
21
|
+
### Windows
|
|
22
|
+
|
|
23
|
+
A **window** is a container for UI elements that belongs to an application. Each window has:
|
|
24
|
+
- A unique `windowId` identifier
|
|
25
|
+
- A `packageName` identifying the owning application
|
|
26
|
+
- Bounds (`rect`) defining its position and size on screen
|
|
27
|
+
- A Z-order (`layer`) determining which window appears on top
|
|
28
|
+
- A `type` indicating the window type (application, input method, system, etc.)
|
|
29
|
+
- A `title` (may be null)
|
|
30
|
+
- A `physicalDisplayId` (physical display identifier, may be null) - returned as a string
|
|
31
|
+
- A `virtualDisplayId` (virtual display identifier, may be null) - only set for virtual displays
|
|
32
|
+
- State flags: `isActive`, `isFocused`, `isAccessibilityFocused`, `isInPictureInPictureMode`
|
|
33
|
+
|
|
34
|
+
You can list all available windows using the [`mobile: listWindows`](../README.md#mobile-listwindows) command, which is essential for understanding the window structure in multi-window scenarios.
|
|
35
|
+
|
|
36
|
+
### Displays
|
|
37
|
+
|
|
38
|
+
A **display** (also called a logical display) is a virtual screen that can contain multiple windows. Each display has:
|
|
39
|
+
- A `displayId` identifier (typically `0` for the default display) - this is the logical display ID
|
|
40
|
+
- A `name` (display name, may be null)
|
|
41
|
+
- A `physicalId` (physical display identifier) that maps to the actual hardware display
|
|
42
|
+
- A `virtualId` (virtual display identifier, may be null) - only set for virtual displays
|
|
43
|
+
- Display metrics (width, height, density, DPI, etc.)
|
|
44
|
+
|
|
45
|
+
On Android, the default display (`displayId = 0`) is always present. Additional displays can be created for:
|
|
46
|
+
- External monitors connected via USB-C or HDMI
|
|
47
|
+
- Wireless displays
|
|
48
|
+
- Virtual displays created by applications
|
|
49
|
+
|
|
50
|
+
You can list all available displays using the [`mobile: listDisplays`](../README.md#mobile-listdisplays) command to see both logical and physical display identifiers along with their metrics.
|
|
51
|
+
|
|
52
|
+
### Hardware Displays
|
|
53
|
+
|
|
54
|
+
A **hardware display** (physical display) is the actual physical screen hardware. Multiple logical displays can map to the same physical display, or a single logical display can span multiple physical displays.
|
|
55
|
+
|
|
56
|
+
### Multi-Display Support
|
|
57
|
+
|
|
58
|
+
**Android API 30+ (Android R):**
|
|
59
|
+
- Full multi-display support is available
|
|
60
|
+
- The driver can access windows from all displays using `getWindowsOnAllDisplays()`
|
|
61
|
+
- The `currentDisplayId` setting allows you to target a specific display for element lookup
|
|
62
|
+
- Window operations respect the selected display context
|
|
63
|
+
|
|
64
|
+
**Before Android API 30:**
|
|
65
|
+
- Only the default display (`displayId = 0`) is accessible
|
|
66
|
+
- `getWindows()` only returns windows from the default display
|
|
67
|
+
- Multi-display operations are not supported
|
|
68
|
+
- The `currentDisplayId` setting has no effect
|
|
69
|
+
|
|
70
|
+
## Using `mobile: listWindows` to Inspect Window Structure
|
|
71
|
+
|
|
72
|
+
The `mobile: listWindows` command is a powerful tool for understanding and debugging multi-window applications. It returns information about all windows currently available on the device, including their properties and relationships.
|
|
73
|
+
|
|
74
|
+
### Basic Usage
|
|
75
|
+
|
|
76
|
+
```python
|
|
77
|
+
# List all windows without filters
|
|
78
|
+
windows = driver.execute_script('mobile: listWindows')
|
|
79
|
+
|
|
80
|
+
# Print information about each window
|
|
81
|
+
for window in windows:
|
|
82
|
+
print(f"Window ID: {window['windowId']}")
|
|
83
|
+
print(f"Display ID: {window['displayId']}")
|
|
84
|
+
print(f"Physical Display ID: {window['physicalDisplayId']}")
|
|
85
|
+
if window.get('virtualDisplayId'):
|
|
86
|
+
print(f"Virtual Display ID: {window['virtualDisplayId']}")
|
|
87
|
+
print(f"Package: {window['packageName']}")
|
|
88
|
+
print(f"Type: {window['type']}")
|
|
89
|
+
print(f"Title: {window['title']}")
|
|
90
|
+
print(f"Layer: {window['layer']}")
|
|
91
|
+
print(f"Active: {window['isActive']}, Focused: {window['isFocused']}")
|
|
92
|
+
print(f"Bounds: {window['rect']}")
|
|
93
|
+
print("---")
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
### Filtering Windows
|
|
97
|
+
|
|
98
|
+
You can filter the results to find specific windows:
|
|
99
|
+
|
|
100
|
+
```python
|
|
101
|
+
# Find windows from a specific package
|
|
102
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
103
|
+
'filters': {
|
|
104
|
+
'packageName': 'com.example.myapp'
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
# Find windows on a specific display
|
|
109
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
110
|
+
'filters': {
|
|
111
|
+
'displayId': 0
|
|
112
|
+
}
|
|
113
|
+
})
|
|
114
|
+
|
|
115
|
+
# Find windows by physical display ID (note: physicalDisplayId is a string)
|
|
116
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
117
|
+
'filters': {
|
|
118
|
+
'physicalDisplayId': '1234567890'
|
|
119
|
+
}
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
# Find a specific window by ID
|
|
123
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
124
|
+
'filters': {
|
|
125
|
+
'windowId': 42
|
|
126
|
+
}
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
# Combine multiple filters (AND logic)
|
|
130
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
131
|
+
'filters': {
|
|
132
|
+
'packageName': 'com.example.myapp',
|
|
133
|
+
'displayId': 0
|
|
134
|
+
}
|
|
135
|
+
})
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
### Advanced Filtering Options
|
|
139
|
+
|
|
140
|
+
The `mobile: listWindows` method supports many filter options:
|
|
141
|
+
|
|
142
|
+
```python
|
|
143
|
+
# Filter by package name with glob patterns
|
|
144
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
145
|
+
'filters': {
|
|
146
|
+
'packageName': 'com.example.*' # Glob pattern support
|
|
147
|
+
}
|
|
148
|
+
})
|
|
149
|
+
|
|
150
|
+
# Filter by window type (e.g., TYPE_APPLICATION = 1, TYPE_INPUT_METHOD = 2)
|
|
151
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
152
|
+
'filters': {
|
|
153
|
+
'type': 1 # Application windows only
|
|
154
|
+
}
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
# Filter by window title with glob patterns
|
|
158
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
159
|
+
'filters': {
|
|
160
|
+
'title': 'My App*' # Glob pattern support
|
|
161
|
+
}
|
|
162
|
+
})
|
|
163
|
+
|
|
164
|
+
# Filter by Z-order layer (higher = on top)
|
|
165
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
166
|
+
'filters': {
|
|
167
|
+
'layer': 100 # Windows with layer >= 100
|
|
168
|
+
}
|
|
169
|
+
})
|
|
170
|
+
|
|
171
|
+
# Filter by window state
|
|
172
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
173
|
+
'filters': {
|
|
174
|
+
'isActive': True,
|
|
175
|
+
'isFocused': True
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
|
|
179
|
+
# Filter for picture-in-picture windows
|
|
180
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
181
|
+
'filters': {
|
|
182
|
+
'isInPictureInPictureMode': True
|
|
183
|
+
}
|
|
184
|
+
})
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Skipping Screenshots for Performance
|
|
188
|
+
|
|
189
|
+
By default, `mobile: listWindows` attempts to take screenshots of each window (on Android API 34+). You can skip this for better performance:
|
|
190
|
+
|
|
191
|
+
```python
|
|
192
|
+
# Skip screenshots to improve performance
|
|
193
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
194
|
+
'skipScreenshots': True
|
|
195
|
+
})
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Practical Use Cases
|
|
199
|
+
|
|
200
|
+
**1. Debugging Window Visibility Issues:**
|
|
201
|
+
```python
|
|
202
|
+
# Check if your app's window is visible
|
|
203
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
204
|
+
'filters': {'packageName': 'com.example.myapp'}
|
|
205
|
+
})
|
|
206
|
+
if not windows:
|
|
207
|
+
print("App window not found!")
|
|
208
|
+
else:
|
|
209
|
+
print(f"Found {len(windows)} window(s) from the app")
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
**2. Finding System Windows (like keyboards):**
|
|
213
|
+
```python
|
|
214
|
+
# Find all system windows
|
|
215
|
+
all_windows = driver.execute_script('mobile: listWindows', {})
|
|
216
|
+
system_windows = [w for w in all_windows if w['packageName'] and 'android' in w['packageName']]
|
|
217
|
+
print(f"Found {len(system_windows)} system windows")
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**3. Understanding Multi-Display Setup:**
|
|
221
|
+
```python
|
|
222
|
+
# First, list all displays to understand the display structure
|
|
223
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
224
|
+
for display in displays:
|
|
225
|
+
print(f"Logical Display ID: {display['id']}")
|
|
226
|
+
print(f" Name: {display['name']}")
|
|
227
|
+
print(f" Physical ID: {display['physicalId']}")
|
|
228
|
+
if display.get('virtualId'):
|
|
229
|
+
print(f" Virtual ID: {display['virtualId']}")
|
|
230
|
+
print(f" Is default: {display['isDefault']}")
|
|
231
|
+
print(f" Size: {display['metrics']['widthPixels']}x{display['metrics']['heightPixels']}")
|
|
232
|
+
|
|
233
|
+
# Group windows by display
|
|
234
|
+
windows = driver.execute_script('mobile: listWindows', {})
|
|
235
|
+
windows_by_display = {}
|
|
236
|
+
for window in windows:
|
|
237
|
+
display_id = window['displayId']
|
|
238
|
+
if display_id not in windows_by_display:
|
|
239
|
+
windows_by_display[display_id] = []
|
|
240
|
+
windows_by_display[display_id].append(window)
|
|
241
|
+
|
|
242
|
+
print(f"Windows on each display: {windows_by_display}")
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
**4. Finding Active or Focused Windows:**
|
|
246
|
+
```python
|
|
247
|
+
# Find the currently active window
|
|
248
|
+
active_windows = driver.execute_script('mobile: listWindows', {
|
|
249
|
+
'filters': {'isActive': True}
|
|
250
|
+
})
|
|
251
|
+
|
|
252
|
+
# Find windows with input focus
|
|
253
|
+
focused_windows = driver.execute_script('mobile: listWindows', {
|
|
254
|
+
'filters': {'isFocused': True}
|
|
255
|
+
})
|
|
256
|
+
|
|
257
|
+
# Find the topmost window (highest layer) from your app
|
|
258
|
+
app_windows = driver.execute_script('mobile: listWindows', {
|
|
259
|
+
'filters': {'packageName': 'com.example.myapp'}
|
|
260
|
+
})
|
|
261
|
+
if app_windows:
|
|
262
|
+
topmost = max(app_windows, key=lambda w: w['layer'])
|
|
263
|
+
print(f"Topmost window layer: {topmost['layer']}")
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
**5. Using Display Information:**
|
|
267
|
+
```python
|
|
268
|
+
# Get display information using mobile: listDisplays
|
|
269
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
270
|
+
|
|
271
|
+
# Find the default display
|
|
272
|
+
default_display = next((d for d in displays if d['isDefault']), None)
|
|
273
|
+
if default_display:
|
|
274
|
+
print(f"Default display: {default_display['id']}")
|
|
275
|
+
print(f" Physical ID: {default_display['physicalId']}")
|
|
276
|
+
print(f" Density: {default_display['metrics']['density']}")
|
|
277
|
+
|
|
278
|
+
# Use display metrics to calculate coordinates
|
|
279
|
+
for display in displays:
|
|
280
|
+
metrics = display['metrics']
|
|
281
|
+
center_x = metrics['widthPixels'] / 2
|
|
282
|
+
center_y = metrics['heightPixels'] / 2
|
|
283
|
+
print(f"Display {display['id']} center: ({center_x}, {center_y})")
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
## Using `mobile: listDisplays` to Inspect Display Information
|
|
287
|
+
|
|
288
|
+
The [`mobile: listDisplays`](../README.md#mobile-listdisplays) command provides information about all displays available on the device, including both logical and physical display identifiers along with detailed metrics.
|
|
289
|
+
|
|
290
|
+
### Basic Usage
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
# List all displays
|
|
294
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
295
|
+
|
|
296
|
+
# Print information about each display
|
|
297
|
+
for display in displays:
|
|
298
|
+
print(f"Logical Display ID: {display['id']}")
|
|
299
|
+
print(f" Name: {display['name']}")
|
|
300
|
+
print(f" Physical ID: {display['physicalId']}")
|
|
301
|
+
if display.get('virtualId'):
|
|
302
|
+
print(f" Virtual ID: {display['virtualId']}")
|
|
303
|
+
print(f" Is default: {display['isDefault']}")
|
|
304
|
+
print(f" Size: {display['metrics']['widthPixels']}x{display['metrics']['heightPixels']}")
|
|
305
|
+
print(f" Density: {display['metrics']['density']} ({display['metrics']['densityDpi']} DPI)")
|
|
306
|
+
print("---")
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### Understanding Display Metrics
|
|
310
|
+
|
|
311
|
+
Each display includes detailed metrics that can be useful for:
|
|
312
|
+
- Calculating screen coordinates
|
|
313
|
+
- Understanding display density for scaling
|
|
314
|
+
- Determining display capabilities
|
|
315
|
+
|
|
316
|
+
```python
|
|
317
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
318
|
+
for display in displays:
|
|
319
|
+
metrics = display['metrics']
|
|
320
|
+
|
|
321
|
+
# Calculate display center
|
|
322
|
+
center_x = metrics['widthPixels'] / 2
|
|
323
|
+
center_y = metrics['heightPixels'] / 2
|
|
324
|
+
|
|
325
|
+
# Calculate density-independent pixels (dp)
|
|
326
|
+
dp_width = metrics['widthPixels'] / metrics['density']
|
|
327
|
+
dp_height = metrics['heightPixels'] / metrics['density']
|
|
328
|
+
|
|
329
|
+
print(f"Display {display['id']}:")
|
|
330
|
+
print(f" Physical pixels: {metrics['widthPixels']}x{metrics['heightPixels']}")
|
|
331
|
+
print(f" Density-independent: {dp_width:.1f}x{dp_height:.1f} dp")
|
|
332
|
+
print(f" Center: ({center_x}, {center_y})")
|
|
333
|
+
print(f" Physical DPI: {metrics['xdpi']:.1f}x{metrics['ydpi']:.1f}")
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Finding the Default Display
|
|
337
|
+
|
|
338
|
+
```python
|
|
339
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
340
|
+
default_display = next((d for d in displays if d['isDefault']), None)
|
|
341
|
+
|
|
342
|
+
if default_display:
|
|
343
|
+
print(f"Default display ID: {default_display['id']}")
|
|
344
|
+
print(f"Default display physical ID: {default_display['physicalId']}")
|
|
345
|
+
```
|
|
346
|
+
|
|
347
|
+
### Getting Physical Display IDs for Screenshots
|
|
348
|
+
|
|
349
|
+
The `physicalId` from `mobile: listDisplays` is the recommended way to get physical display IDs for use with `mobile: screenshots`:
|
|
350
|
+
|
|
351
|
+
```python
|
|
352
|
+
# Get physical display IDs
|
|
353
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
354
|
+
|
|
355
|
+
# Take screenshot of each display
|
|
356
|
+
for display in displays:
|
|
357
|
+
if display.get('physicalId'):
|
|
358
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
359
|
+
'displayId': display['physicalId']
|
|
360
|
+
})
|
|
361
|
+
print(f"Screenshot taken for display {display['id']} (physical: {display['physicalId']})")
|
|
362
|
+
```
|
|
363
|
+
|
|
364
|
+
## Element Location Strategy in Multi-Window Applications
|
|
365
|
+
|
|
366
|
+
The UiAutomator2 driver uses different strategies for locating elements depending on the locator type and settings configuration.
|
|
367
|
+
|
|
368
|
+
### UiObject2-Based Locators (Recommended)
|
|
369
|
+
|
|
370
|
+
UiObject2-based locators support multi-window scenarios and are affected by the following settings:
|
|
371
|
+
|
|
372
|
+
- **`id`** (resource ID)
|
|
373
|
+
- **`accessibility id`** (content description)
|
|
374
|
+
- **`className`**
|
|
375
|
+
- **`xpath`** (when used with proper window context)
|
|
376
|
+
|
|
377
|
+
These locators work with the window selection logic controlled by `enableMultiWindows`, `currentDisplayId` and `enableTopmostWindowFromActivePackage` settings.
|
|
378
|
+
|
|
379
|
+
### Legacy UiObject-Based Selectors (Limited Support)
|
|
380
|
+
|
|
381
|
+
The **`-android uiautomator`** strategy uses the legacy `UiSelector` API, which:
|
|
382
|
+
- **Does not support multi-window lookups**
|
|
383
|
+
- Only searches within the active window
|
|
384
|
+
- Cannot access elements in other windows even when `enableMultiWindows` is enabled
|
|
385
|
+
- Should be avoided for multi-window scenarios
|
|
386
|
+
|
|
387
|
+
If you need to use UiSelector-based locators, consider using the newer UiObject2-based alternatives instead.
|
|
388
|
+
|
|
389
|
+
## Settings That Affect Element Location
|
|
390
|
+
|
|
391
|
+
### `currentDisplayId`
|
|
392
|
+
|
|
393
|
+
**Type:** `integer`
|
|
394
|
+
**Default:** `0` (default display)
|
|
395
|
+
**Available since:** Android API 30+
|
|
396
|
+
|
|
397
|
+
The `currentDisplayId` setting determines which display is used for element lookup operations when using UiObject2-based locators.
|
|
398
|
+
|
|
399
|
+
**How it works:**
|
|
400
|
+
- When set to a specific display ID, all element lookups are scoped to that display
|
|
401
|
+
- Only windows from the specified display are considered during element search
|
|
402
|
+
- This setting is applied to `BySelector` objects via the `displayId()` method
|
|
403
|
+
- If the specified display ID doesn't exist, an error is thrown
|
|
404
|
+
- Set to `-1` to reset the setting to its default behavior (use the default display)
|
|
405
|
+
|
|
406
|
+
**Example:**
|
|
407
|
+
```python
|
|
408
|
+
# Set the current display to display 1
|
|
409
|
+
driver.update_settings({'currentDisplayId': 1})
|
|
410
|
+
|
|
411
|
+
# Now all element lookups will search only on display 1
|
|
412
|
+
element = driver.find_element('id', 'myButton')
|
|
413
|
+
|
|
414
|
+
# Reset to default display behavior
|
|
415
|
+
driver.update_settings({'currentDisplayId': -1})
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
**Note:** This setting only affects UiObject2-based locators (`id`, `accessibility id`, `className`). It has no effect on legacy `-android uiautomator` selectors or xpath lookups (which use their own window selection logic).
|
|
419
|
+
|
|
420
|
+
**Screenshot Behavior:**
|
|
421
|
+
- When `currentDisplayId` is set to a custom value, the standard `getScreenshot()` method will take a screenshot of the specified display
|
|
422
|
+
|
|
423
|
+
**Coordinate-Based Gesture Behavior:**
|
|
424
|
+
- Coordinate-based gestures (taps, swipes, drags, etc. performed using x/y coordinates) are executed on either the default active display or the display specified by `currentDisplayId`
|
|
425
|
+
- When `currentDisplayId` is set, all coordinate-based gestures will target that display
|
|
426
|
+
- This includes gestures performed via:
|
|
427
|
+
- W3C Actions API (pointer actions with coordinates)
|
|
428
|
+
- Mobile gesture commands (`mobile: clickGesture`, `mobile: swipeGesture`, etc.) when coordinates are provided
|
|
429
|
+
- Direct coordinate-based interactions
|
|
430
|
+
- This ensures that gestures are performed on the correct display in multi-display scenarios
|
|
431
|
+
|
|
432
|
+
**Example:**
|
|
433
|
+
```python
|
|
434
|
+
# Set display 1 as current
|
|
435
|
+
driver.update_settings({'currentDisplayId': 1})
|
|
436
|
+
|
|
437
|
+
# Coordinate-based gestures will now target display 1
|
|
438
|
+
driver.execute_script('mobile: clickGesture', {'x': 100, 'y': 200})
|
|
439
|
+
|
|
440
|
+
# Reset to default display
|
|
441
|
+
driver.update_settings({'currentDisplayId': 0})
|
|
442
|
+
|
|
443
|
+
# Gestures will now target the default display
|
|
444
|
+
driver.execute_script('mobile: clickGesture', {'x': 100, 'y': 200})
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
### `enableMultiWindows`
|
|
448
|
+
|
|
449
|
+
**Type:** `boolean`
|
|
450
|
+
**Default:** `false`
|
|
451
|
+
|
|
452
|
+
The `enableMultiWindows` setting controls whether multiple windows are included in the accessibility tree used for element location and page source generation.
|
|
453
|
+
|
|
454
|
+
**When `false` (default):**
|
|
455
|
+
- Only the active window's root node is retrieved
|
|
456
|
+
- Element lookups search only within the active window
|
|
457
|
+
- Page source contains only the active window's hierarchy
|
|
458
|
+
- This is the fastest and most common configuration
|
|
459
|
+
|
|
460
|
+
**When `true`:**
|
|
461
|
+
- All accessible windows are retrieved and included in the accessibility tree
|
|
462
|
+
- Element lookups can find elements across all windows
|
|
463
|
+
- Page source includes content from all windows
|
|
464
|
+
- Useful when you need to interact with system windows (like keyboards) or overlay windows
|
|
465
|
+
|
|
466
|
+
**Example:**
|
|
467
|
+
```python
|
|
468
|
+
# Enable multi-window mode
|
|
469
|
+
driver.update_settings({'enableMultiWindows': True})
|
|
470
|
+
|
|
471
|
+
# Now you can find elements in the on-screen keyboard or other windows
|
|
472
|
+
keyboard_key = driver.find_element('id', 'keyboard_key_a')
|
|
473
|
+
```
|
|
474
|
+
|
|
475
|
+
**Important considerations:**
|
|
476
|
+
- Enabling this setting may impact performance as more windows need to be processed
|
|
477
|
+
- The window selection logic also depends on `enableTopmostWindowFromActivePackage`
|
|
478
|
+
- This setting affects both element location and page source generation
|
|
479
|
+
|
|
480
|
+
### `enableTopmostWindowFromActivePackage`
|
|
481
|
+
|
|
482
|
+
**Type:** `boolean`
|
|
483
|
+
**Default:** `false`
|
|
484
|
+
|
|
485
|
+
The `enableTopmostWindowFromActivePackage` setting determines which window from the active application package is used when `enableMultiWindows` is `false`.
|
|
486
|
+
|
|
487
|
+
**When `false` (default):**
|
|
488
|
+
- Uses `getRootInActiveWindow()` to get the active window root
|
|
489
|
+
- This is the window that currently has focus
|
|
490
|
+
- May not be the topmost window if the app has multiple windows
|
|
491
|
+
|
|
492
|
+
**When `true`:**
|
|
493
|
+
- Searches all windows from the active package
|
|
494
|
+
- Selects the window with the highest Z-order (topmost layer)
|
|
495
|
+
- Useful when an app has multiple windows and you want to interact with the one on top
|
|
496
|
+
|
|
497
|
+
**Example:**
|
|
498
|
+
```python
|
|
499
|
+
# Enable topmost window selection
|
|
500
|
+
driver.update_settings({'enableTopmostWindowFromActivePackage': True})
|
|
501
|
+
|
|
502
|
+
# Now element lookups will use the topmost window from your app
|
|
503
|
+
element = driver.find_element('id', 'myButton')
|
|
504
|
+
```
|
|
505
|
+
|
|
506
|
+
**Interaction with `enableMultiWindows`:**
|
|
507
|
+
- When `enableMultiWindows` is `true`, this setting is ignored (all windows are included)
|
|
508
|
+
- When `enableMultiWindows` is `false` and this setting is `true`, only the topmost window from the active package is used
|
|
509
|
+
- When both are `false`, the active window is used
|
|
510
|
+
|
|
511
|
+
## How Settings Affect Page Source Generation
|
|
512
|
+
|
|
513
|
+
The page source (XML hierarchy) generation is directly affected by the window selection settings. **Note:** XPath lookups use the same page source, so the rules described here apply to both page source generation and XPath queries.
|
|
514
|
+
|
|
515
|
+
The interaction between `enableMultiWindows` and `currentDisplayId` determines which windows are included:
|
|
516
|
+
|
|
517
|
+
### When `enableMultiWindows` is `true` and `currentDisplayId` is set
|
|
518
|
+
|
|
519
|
+
- Only windows belonging to the specified display are included in the page source
|
|
520
|
+
- Each window's hierarchy from that display is merged into the XML tree
|
|
521
|
+
- Fastest multi-window configuration since it's limited to one display
|
|
522
|
+
- Elements from windows on other displays are not visible in the page source
|
|
523
|
+
|
|
524
|
+
### When `enableMultiWindows` is `true` and `currentDisplayId` is not customized
|
|
525
|
+
|
|
526
|
+
- All accessible windows from all displays are included in the page source
|
|
527
|
+
- Each window's hierarchy is merged into the XML tree
|
|
528
|
+
- You can see elements from:
|
|
529
|
+
- The main application window
|
|
530
|
+
- On-screen keyboard
|
|
531
|
+
- System dialogs
|
|
532
|
+
- Overlay windows
|
|
533
|
+
- Other application windows (in split-screen mode)
|
|
534
|
+
- Windows from all connected displays
|
|
535
|
+
|
|
536
|
+
### When `enableMultiWindows` is `false` and `currentDisplayId` is set
|
|
537
|
+
|
|
538
|
+
- Only the active window's hierarchy is included
|
|
539
|
+
- `currentDisplayId` is effectively ignored in this case, as only the active window is used regardless of which display it's on
|
|
540
|
+
- Fastest generation time
|
|
541
|
+
- Smallest XML output
|
|
542
|
+
- Elements from other windows are not visible in the page source
|
|
543
|
+
|
|
544
|
+
### When `enableMultiWindows` is `false` and `currentDisplayId` is not customized
|
|
545
|
+
|
|
546
|
+
- Only the active window's hierarchy is included (or topmost window if `enableTopmostWindowFromActivePackage: true`)
|
|
547
|
+
- Fastest generation time
|
|
548
|
+
- Smallest XML output
|
|
549
|
+
- Elements from other windows are not visible in the page source
|
|
550
|
+
|
|
551
|
+
### XPath Lookups
|
|
552
|
+
|
|
553
|
+
XPath lookups use the same window selection logic as page source generation. The interaction between `enableMultiWindows` and `currentDisplayId` determines which windows are included:
|
|
554
|
+
|
|
555
|
+
- **When `enableMultiWindows` is `true` and `currentDisplayId` is set**: The page source only includes windows belonging to the specified display. Xpath can find elements across all windows from that display.
|
|
556
|
+
- **When `enableMultiWindows` is `true` and `currentDisplayId` is not customized**: The page source includes windows from all displays. Xpath can find elements across all windows from all displays.
|
|
557
|
+
- **When `enableMultiWindows` is `false` and `currentDisplayId` is set**: The page source only includes the active window. `currentDisplayId` is effectively ignored in this case, as only the active window is used regardless of which display it's on.
|
|
558
|
+
- **When `enableMultiWindows` is `false` and `currentDisplayId` is not customized**: The page source only includes the active window (or topmost window if `enableTopmostWindowFromActivePackage` is `true`). Xpath searches only within that single window.
|
|
559
|
+
|
|
560
|
+
**Using `window-id` Attribute to Fine-Tune XPath Lookups:**
|
|
561
|
+
|
|
562
|
+
When `enableMultiWindows` is enabled and `currentDisplayId` is not customized, elements from multiple windows are included in the page source. Each element has a `window-id` attribute that identifies which window it belongs to. You can use this attribute in your xpath queries to target elements from specific windows.
|
|
563
|
+
|
|
564
|
+
**Important:** Using `window-id` in xpath only makes sense when:
|
|
565
|
+
- `enableMultiWindows` is `true` (multiple windows are included in the page source)
|
|
566
|
+
- `currentDisplayId` is not customized (not set to a specific display)
|
|
567
|
+
|
|
568
|
+
**Why?**
|
|
569
|
+
- When `enableMultiWindows` is `false`, only one window is included in the page source, so all elements have the same `window-id`
|
|
570
|
+
- When `currentDisplayId` is set to a specific display, only windows from that display are included, so all elements would have the same `window-id` (or windows from the same display)
|
|
571
|
+
- Only when multiple windows from potentially different displays are included does the `window-id` attribute provide meaningful differentiation
|
|
572
|
+
|
|
573
|
+
**Example:**
|
|
574
|
+
```python
|
|
575
|
+
# Enable multi-windows for xpath searches (without setting currentDisplayId)
|
|
576
|
+
driver.update_settings({'enableMultiWindows': True})
|
|
577
|
+
|
|
578
|
+
# First, find the window ID you want to target
|
|
579
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
580
|
+
'filters': {'packageName': 'com.example.myapp'}
|
|
581
|
+
})
|
|
582
|
+
target_window_id = windows[0]['windowId']
|
|
583
|
+
|
|
584
|
+
# Use window-id attribute in xpath to target a specific window
|
|
585
|
+
element = driver.find_element('xpath', f'//*[@window-id="{target_window_id}" and @text="My Button"]')
|
|
586
|
+
|
|
587
|
+
# Or find all elements in a specific window
|
|
588
|
+
elements = driver.find_elements('xpath', f'//*[@window-id="{target_window_id}"]')
|
|
589
|
+
```
|
|
590
|
+
|
|
591
|
+
**Note:** The `window-id` attribute is only available when the element's window identifier can be determined. In rare cases, this attribute might not be present for some elements.
|
|
592
|
+
|
|
593
|
+
## Best Practices
|
|
594
|
+
|
|
595
|
+
1. **Use UiObject2-based locators** (`id`, `accessibility id`, `className`) instead of legacy `-android uiautomator` selectors for multi-window scenarios
|
|
596
|
+
|
|
597
|
+
2. **Start with default settings** and only enable `enableMultiWindows` when you specifically need to interact with multiple windows
|
|
598
|
+
|
|
599
|
+
3. **Use `currentDisplayId`** when testing on devices with multiple displays (Android API 30+)
|
|
600
|
+
|
|
601
|
+
4. **Enable `enableTopmostWindowFromActivePackage`** when your app has multiple windows, and you want to interact with the visible one
|
|
602
|
+
|
|
603
|
+
5. **Reset accessibility cache** using [`mobile: resetAccessibilityCache`](../README.md#mobile-resetaccessibilitycache) if you encounter stale element references after window changes
|
|
604
|
+
|
|
605
|
+
6. **List windows** using [`mobile: listWindows`](../README.md#mobile-listwindows) to understand the window structure before writing locators. Use filtering to find specific windows and verify which windows are accessible for element location.
|
|
606
|
+
|
|
607
|
+
## Example: Testing a Split-Screen Application
|
|
608
|
+
|
|
609
|
+
```python
|
|
610
|
+
from appium import webdriver
|
|
611
|
+
from appium.options.android import UiAutomator2Options
|
|
612
|
+
|
|
613
|
+
# Setup
|
|
614
|
+
options = UiAutomator2Options()
|
|
615
|
+
options.app_package = 'com.example.myapp'
|
|
616
|
+
driver = webdriver.Remote('http://localhost:4723', options=options)
|
|
617
|
+
|
|
618
|
+
# Enable multi-window support
|
|
619
|
+
driver.update_settings({
|
|
620
|
+
'enableMultiWindows': True
|
|
621
|
+
})
|
|
622
|
+
|
|
623
|
+
# List all windows to see what's available
|
|
624
|
+
windows = driver.execute_script('mobile: listWindows', {})
|
|
625
|
+
print(f"Found {len(windows)} windows")
|
|
626
|
+
|
|
627
|
+
# Filter to find windows from your app
|
|
628
|
+
app_windows = driver.execute_script('mobile: listWindows', {
|
|
629
|
+
'filters': {'packageName': 'com.example.myapp'}
|
|
630
|
+
})
|
|
631
|
+
print(f"Found {len(app_windows)} windows from the app")
|
|
632
|
+
|
|
633
|
+
# Find elements - now searches across all windows
|
|
634
|
+
element = driver.find_element('id', 'myButton')
|
|
635
|
+
|
|
636
|
+
# Get page source - includes all windows
|
|
637
|
+
source = driver.get_page_source()
|
|
638
|
+
```
|
|
639
|
+
|
|
640
|
+
## Example: Testing on Multiple Displays
|
|
641
|
+
|
|
642
|
+
```python
|
|
643
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
644
|
+
|
|
645
|
+
# Set the current display for element lookups
|
|
646
|
+
driver.update_settings({'currentDisplayId': displays[1]['id']})
|
|
647
|
+
|
|
648
|
+
# All subsequent element lookups will search on the second display
|
|
649
|
+
element = driver.find_element('id', 'myButton')
|
|
650
|
+
|
|
651
|
+
# Screenshots will also be taken from the second display
|
|
652
|
+
screenshot = driver.get_screenshot_as_base64()
|
|
653
|
+
|
|
654
|
+
# Reset to default display (using -1)
|
|
655
|
+
driver.update_settings({'currentDisplayId': -1})
|
|
656
|
+
```
|
|
657
|
+
|
|
658
|
+
## Screenshots and Multi-Display Support
|
|
659
|
+
|
|
660
|
+
Screenshots are an important part of multi-window and multi-display testing. The UiAutomator2 driver provides two methods for taking screenshots that work with multiple displays.
|
|
661
|
+
|
|
662
|
+
### How `currentDisplayId` Affects Screenshots
|
|
663
|
+
|
|
664
|
+
When the `currentDisplayId` setting is configured to a non-default display:
|
|
665
|
+
|
|
666
|
+
- **Standard screenshots** (`getScreenshot()`, `get_screenshot_as_base64()`, etc.) will capture the specified display
|
|
667
|
+
- The driver automatically detects if the display has custom density or is a non-default display
|
|
668
|
+
- For better compatibility with custom displays, the driver may use the `screencap` command instead of the standard screenshot API
|
|
669
|
+
- If the device under test is an emulator and has a virtual display, then it is only possible to take the virtual
|
|
670
|
+
display screenshot since Android API 34 or newer.
|
|
671
|
+
- This ensures that screenshots match the display context you're currently testing
|
|
672
|
+
|
|
673
|
+
**Example:**
|
|
674
|
+
```python
|
|
675
|
+
# Set display 1 as current
|
|
676
|
+
driver.update_settings({'currentDisplayId': 1})
|
|
677
|
+
|
|
678
|
+
# This screenshot will be from display 1
|
|
679
|
+
screenshot = driver.get_screenshot_as_base64()
|
|
680
|
+
|
|
681
|
+
# Reset to default display (using -1)
|
|
682
|
+
driver.update_settings({'currentDisplayId': -1})
|
|
683
|
+
|
|
684
|
+
# Now screenshots will be from the default display
|
|
685
|
+
screenshot = driver.get_screenshot_as_base64()
|
|
686
|
+
```
|
|
687
|
+
|
|
688
|
+
### Using `mobile: screenshots` for Multi-Display Screenshots
|
|
689
|
+
|
|
690
|
+
The [`mobile: screenshots`](../README.md#mobile-screenshots) method provides more control over multi-display screenshot capture. This method is available since Android 10 (API 29).
|
|
691
|
+
|
|
692
|
+
#### Taking Screenshots of All Displays
|
|
693
|
+
|
|
694
|
+
```python
|
|
695
|
+
# Get screenshots of all available displays
|
|
696
|
+
screenshots = driver.execute_script('mobile: screenshots', {})
|
|
697
|
+
|
|
698
|
+
# screenshots is a dictionary where keys are display IDs
|
|
699
|
+
for display_id, display_info in screenshots.items():
|
|
700
|
+
print(f"Display {display_id}: {display_info['name']}")
|
|
701
|
+
print(f" Is default: {display_info['isDefault']}")
|
|
702
|
+
print(f" Screenshot size: {len(display_info['payload'])} bytes")
|
|
703
|
+
# display_info['payload'] contains base64-encoded PNG data
|
|
704
|
+
```
|
|
705
|
+
|
|
706
|
+
#### Taking Screenshots of a Specific Display
|
|
707
|
+
|
|
708
|
+
**Recommended approach:** Use `mobile: listDisplays` to get physical or virtual display IDs:
|
|
709
|
+
|
|
710
|
+
```python
|
|
711
|
+
# Get display ID from mobile: listDisplays (recommended)
|
|
712
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
713
|
+
|
|
714
|
+
# For physical displays, use physicalId
|
|
715
|
+
if displays and displays[0].get('physicalId') is not None:
|
|
716
|
+
display_id = displays[0]['physicalId']
|
|
717
|
+
|
|
718
|
+
# Use the physical display ID to take a screenshot
|
|
719
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
720
|
+
'displayId': display_id
|
|
721
|
+
})
|
|
722
|
+
|
|
723
|
+
# Returns a dictionary with one entry
|
|
724
|
+
display_info = screenshots[display_id]
|
|
725
|
+
screenshot_data = display_info['payload'] # base64-encoded PNG
|
|
726
|
+
|
|
727
|
+
# For virtual displays, use virtualId
|
|
728
|
+
elif displays and displays[0].get('virtualId') is not None:
|
|
729
|
+
display_id = displays[0]['virtualId']
|
|
730
|
+
|
|
731
|
+
# Use the virtual display ID to take a screenshot
|
|
732
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
733
|
+
'displayId': display_id
|
|
734
|
+
})
|
|
735
|
+
|
|
736
|
+
# Returns a dictionary with one entry
|
|
737
|
+
display_info = screenshots[display_id]
|
|
738
|
+
screenshot_data = display_info['payload'] # base64-encoded PNG
|
|
739
|
+
else:
|
|
740
|
+
print("Display ID not available")
|
|
741
|
+
```
|
|
742
|
+
|
|
743
|
+
**Alternative approach:** Get display ID from `mobile: listWindows`:
|
|
744
|
+
|
|
745
|
+
```python
|
|
746
|
+
# Get display ID from a window
|
|
747
|
+
windows = driver.execute_script('mobile: listWindows', {
|
|
748
|
+
'filters': {'packageName': 'com.example.myapp'}
|
|
749
|
+
})
|
|
750
|
+
|
|
751
|
+
if windows:
|
|
752
|
+
window = windows[0]
|
|
753
|
+
display_id = None
|
|
754
|
+
|
|
755
|
+
# Prefer physical display ID, fall back to virtual if available
|
|
756
|
+
if window.get('physicalDisplayId') is not None:
|
|
757
|
+
display_id = window['physicalDisplayId']
|
|
758
|
+
elif window.get('virtualDisplayId') is not None:
|
|
759
|
+
display_id = window['virtualDisplayId']
|
|
760
|
+
|
|
761
|
+
if display_id:
|
|
762
|
+
# Use the display ID to take a screenshot
|
|
763
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
764
|
+
'displayId': display_id
|
|
765
|
+
})
|
|
766
|
+
|
|
767
|
+
# Returns a dictionary with one entry
|
|
768
|
+
display_info = screenshots[display_id]
|
|
769
|
+
screenshot_data = display_info['payload'] # base64-encoded PNG
|
|
770
|
+
else:
|
|
771
|
+
print("Display ID not available for this window")
|
|
772
|
+
```
|
|
773
|
+
|
|
774
|
+
**Direct usage:** You can also use a known physical or virtual display ID directly:
|
|
775
|
+
|
|
776
|
+
```python
|
|
777
|
+
# Get screenshot of a specific physical display ID
|
|
778
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
779
|
+
'displayId': '1234567890' # Physical display ID (string)
|
|
780
|
+
})
|
|
781
|
+
|
|
782
|
+
# Or use a virtual display ID
|
|
783
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
784
|
+
'displayId': '12345' # Virtual display ID (string)
|
|
785
|
+
})
|
|
786
|
+
|
|
787
|
+
# Returns a dictionary with one entry
|
|
788
|
+
display_info = screenshots['1234567890'] # or '12345' for virtual
|
|
789
|
+
screenshot_data = display_info['payload'] # base64-encoded PNG
|
|
790
|
+
```
|
|
791
|
+
|
|
792
|
+
#### Understanding Display Identifiers
|
|
793
|
+
|
|
794
|
+
**Important:** The display identifiers used by `mobile: screenshots` are **physical or virtual display IDs**, which are different from the logical display IDs used by `currentDisplayId` setting.
|
|
795
|
+
|
|
796
|
+
- **Logical display ID** (`currentDisplayId`): Used for element location, window operations, and standard screenshots. Typically starts at 0. You can get this from the `id` field returned by `mobile: listDisplays`.
|
|
797
|
+
- **Physical display ID** (`mobile: screenshots`): Used for the `mobile: screenshots` method with physical displays. Returned as a string to avoid JavaScript number precision issues. You can get this value from:
|
|
798
|
+
- The `physicalId` field returned by `mobile: listDisplays` (recommended)
|
|
799
|
+
- The `physicalDisplayId` field returned by `mobile: listWindows` (note: this is a string)
|
|
800
|
+
- The `adb shell dumpsys SurfaceFlinger --display-id` command output
|
|
801
|
+
- **Virtual display ID** (`mobile: screenshots`): Used for the `mobile: screenshots` method with virtual displays. Returned as a string. You can get this value from:
|
|
802
|
+
- The `virtualId` field returned by `mobile: listDisplays` (recommended)
|
|
803
|
+
- The `virtualDisplayId` field returned by `mobile: listWindows` (note: this is a string)
|
|
804
|
+
- The `adb shell dumpsys SurfaceFlinger --display-id` command output
|
|
805
|
+
|
|
806
|
+
**Example workflow:**
|
|
807
|
+
```python
|
|
808
|
+
# 1. List displays to see all available displays with their IDs
|
|
809
|
+
displays = driver.execute_script('mobile: listDisplays')
|
|
810
|
+
for display in displays:
|
|
811
|
+
print(f"Logical Display ID: {display['id']}")
|
|
812
|
+
print(f" Physical ID: {display['physicalId']}")
|
|
813
|
+
if display.get('virtualId'):
|
|
814
|
+
print(f" Virtual ID: {display['virtualId']}")
|
|
815
|
+
print(f" Is default: {display['isDefault']}")
|
|
816
|
+
print(f" Size: {display['metrics']['widthPixels']}x{display['metrics']['heightPixels']}")
|
|
817
|
+
|
|
818
|
+
# 2. List windows to see which windows are on which displays
|
|
819
|
+
windows = driver.execute_script('mobile: listWindows', {})
|
|
820
|
+
for window in windows:
|
|
821
|
+
print(f"Window ID: {window['windowId']}")
|
|
822
|
+
print(f" Logical display ID: {window['displayId']}")
|
|
823
|
+
print(f" Physical display ID: {window['physicalDisplayId']}") # Note: string type
|
|
824
|
+
if window.get('virtualDisplayId'):
|
|
825
|
+
print(f" Virtual display ID: {window['virtualDisplayId']}")
|
|
826
|
+
print(f" Package: {window['packageName']}")
|
|
827
|
+
print(f" Type: {window['type']}, Layer: {window['layer']}")
|
|
828
|
+
|
|
829
|
+
# 3. Use currentDisplayId for element operations (logical display)
|
|
830
|
+
driver.update_settings({'currentDisplayId': 0}) # Or use -1 to reset to default
|
|
831
|
+
element = driver.find_element('id', 'myButton')
|
|
832
|
+
|
|
833
|
+
# 4. Use mobile: screenshots with physical or virtual display IDs
|
|
834
|
+
# Get display ID from mobile: listDisplays (recommended)
|
|
835
|
+
default_display = next((d for d in displays if d['isDefault']), None)
|
|
836
|
+
if default_display:
|
|
837
|
+
# Prefer physical ID, fall back to virtual ID if available
|
|
838
|
+
display_id = default_display.get('physicalId') or default_display.get('virtualId')
|
|
839
|
+
if display_id:
|
|
840
|
+
screenshots = driver.execute_script('mobile: screenshots', {
|
|
841
|
+
'displayId': display_id
|
|
842
|
+
})
|
|
843
|
+
display_info = screenshots[display_id]
|
|
844
|
+
screenshot_data = display_info['payload']
|
|
845
|
+
```
|
|
846
|
+
|
|
847
|
+
**Example:**
|
|
848
|
+
```python
|
|
849
|
+
screenshots = driver.execute_script('mobile: screenshots', {})
|
|
850
|
+
|
|
851
|
+
for display_id, info in screenshots.items():
|
|
852
|
+
print(f"Display ID: {display_id}")
|
|
853
|
+
print(f" Name: {info['name']}")
|
|
854
|
+
print(f" Default: {info['isDefault']}")
|
|
855
|
+
print(f" Screenshot: {info['payload'][:50]}...") # First 50 chars
|
|
856
|
+
```
|
|
857
|
+
|
|
858
|
+
### Best Practices for Screenshots in Multi-Display Scenarios
|
|
859
|
+
|
|
860
|
+
1. **Use `currentDisplayId` for standard screenshots** when you want screenshots to match your current testing context
|
|
861
|
+
2. **Use `mobile: screenshots`** when you need screenshots from multiple displays simultaneously or want to target specific physical or virtual displays
|
|
862
|
+
3. **Be aware of the difference** between logical display IDs (`currentDisplayId`) and physical/virtual display IDs (`mobile: screenshots`)
|
|
863
|
+
4. **Use `mobile: listDisplays`** to get display IDs - This is the recommended way to obtain physical or virtual display IDs along with display metrics. The `physicalId` field (for physical displays) or `virtualId` field (for virtual displays), both returned as strings, can be used directly with `mobile: screenshots`
|
|
864
|
+
5. **Use `mobile: listWindows`** to understand which windows are on which displays - The `physicalDisplayId` field (for physical displays) or `virtualDisplayId` field (for virtual displays), both returned as strings, can also be used with `mobile: screenshots` if you need to screenshot the display containing a specific window
|
|
865
|
+
6. **Alternative: Use `adb shell dumpsys SurfaceFlinger --display-id`** if you need to find all display IDs without using the driver methods
|
|
866
|
+
|
|
867
|
+
## References
|
|
868
|
+
|
|
869
|
+
- [Android Multi-Window Support](https://developer.android.com/guide/topics/large-screens/multi-window-support)
|
|
870
|
+
- [AccessibilityWindowInfo API](https://developer.android.com/reference/android/view/accessibility/AccessibilityWindowInfo)
|
|
871
|
+
- [UiAutomator2 Server Source Code](https://github.com/appium/appium-uiautomator2-server)
|
|
872
|
+
|