【发布时间】:2016-10-13 09:41:45
【问题描述】:
我希望在不重置其状态的情况下测试我的 android 应用程序。我注意到每次运行应用程序时都会出现不同的弹出窗口,所以我希望记录所有不同的弹出窗口。
我在这里对“运行”的定义是点击手机上的返回按钮并再次点击我的应用程序图标。
但是,我无法在我的 Appium 测试中模拟手机的这种物理敲击。我可以退出我的第一个测试,但我无法再次重新打开我的应用程序。 (模拟用手指点击应用程序图标)
我尝试过的事情:
1. Setting noReset to true in capabilities setting
2. Using uiautomator to find my application. However, uiautomator doesn't seem to be able to detect any icons in the app menu page. It just shows many layers of frame layouts.
3. closeApp() and launchApp() resets the application and this defeats the purpose of my test. My application somehow behaves differently with each run so I hope to run my test in a single session (i.e. closing and opening the application while it is still in the same state)
无论如何我可以以代码的形式模拟图标的物理点击吗?我知道我们可以设置坐标,但我不想硬编码我的测试只在手机的特定实例上运行。如果卸载了其他应用程序并且我的应用程序图标移动到另一个位置,它将无法运行。
【问题讨论】:
标签: java android selenium-webdriver appium