八戒你干嘛 发表于 2019-1-15 15:15:09

Appium问题集合

uiautomatorviewer和appium无法捕获App页面报错uiautomatorviewer报错Error obtaining ui hierarchy
Reason:
error taking device screenshot:EOFappium报错App Source Could not obtain source: 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找到需要定位的元素
页: [1]
查看完整版本: Appium问题集合