首页 > 移动平台 > 详细

appium定位H5页面

时间:2018-09-18 13:34:27      阅读:273      评论:0      收藏:0      [点我收藏+]
手机端由原生切换为H5,定位不到元素。需要将apk开启调试模式:在入口Activity中添加2行代码,如下
if (Build.VERSION.SDK_INT >=Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}

效果如下:
protected void onCreate(Bundle savedInstanceState) {
setContentView(R.layout.activity_main);
super.onCreate(savedInstanceState);
context = this;
if (Build.VERSION.SDK_INT >=Build.VERSION_CODES.KITKAT) {
WebView.setWebContentsDebuggingEnabled(true);
}
   ......
......

appium定位H5页面

原文:https://www.cnblogs.com/jdm532000/p/9668335.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!