【问题标题】:Can I access UI components of multiple applications while testing with UIautomator?我可以在使用 UIautomator 进行测试时访问多个应用程序的 UI 组件吗?
【发布时间】:2025-12-12 12:00:01
【问题描述】:

我正在使用 UIautomator 测试 Android 应用程序。就我在 UIautomatorviewer 中看到的而言,我可以在屏幕截图中了解 UI 组件的所有 id。这是否意味着即使目标应用程序调用另一个应用程序,我也可以访问 UI 组件。例如,当按下某个按钮时,PhotoStream 应用程序调用 Gallery 应用程序,并从 Gallery 应用程序接收输出。我想实现测试代码,如果 UIautomator 提供一个 API 来访问另一个被调用的应用程序中的 UI 组件,它会自动在 Gallery 应用程序中按下按钮。 UIautomator API 提供这样的东西吗?

【问题讨论】:

    标签: android testing android-uiautomator


    【解决方案1】:

    使用 UiAutomator,您可以访问屏幕上可见的任何应用。你不需要任何额外的 API

    【讨论】:

      最近更新 更多