网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  IT文章  >  appium-Could not obtain screenshot: [object Object]

appium-Could not obtain screenshot: [object Object]

分类: IT文章 • 2022-06-04 11:29:49

原因

App页面已经被禁止截屏,禁用用户截屏的代码如下:

getWindow().addFlags(WindowManager.LayoutParams.FLAG_SECURE);
setContentView(R.layout.activity_main);

解决

但是通过app source还是可以看到的

或者执行代码,进入该页面,通过String source = driver.getPageSource();获取该页面的dom,通过dom找到需要定位的元素。

相关推荐

  • topGO 精选资料 1 obtain input genes 2 set-up the enrichment object based on your genes 3 perfom gene enrichment. Here, we make use of the rank information by using the Kolmogorov-Smirnov (K-S) test on the enriched terms
  • appium-Could not obtain screenshot: [object Object]
  • 【Android】【问题解决记录】Error obtaining UI hierarchy :Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist!  Error while obtaining UI hierarchy XML file: com.android.ddmlib.SyncException: Remote object doesn't exist! Error taking device screenshot: EOF
  • 数据备份基础之备份类型
  • 从实验室搬到宿舍后可以上QQ但打不开网页
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号