51Testing软件测试论坛
标题: Appium问题集合 [打印本页]
作者: 八戒你干嘛 时间: 2019-1-15 15:15
标题: Appium问题集合
uiautomatorviewer和appium无法捕获App页面报错uiautomatorviewer报错
- Error obtaining ui hierarchy
- Reason:
- error taking device screenshot:EOF
复制代码appium报错
- App Source Could not obtain source: [object Object]
复制代码appium server日志报错
- Error: Cannot get screenshot data because of 'The size of the taken screenshot equals to zero.'. Make sure the 'LayoutParams.FLAG_SECURE' is not set for the current view
复制代码 原因App页面已经被禁止截屏,禁用用户截屏的代码如下:
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
- setContentView(R.layout.activity_main);
- 解决
复制代码执行代码,进入该页面,通过String source = driver.getPageSource();获取该页面的dom,通过dom找到需要定位的元素
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) |
Powered by Discuz! X3.2 |