栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 系统运维 > 运维 > Linux

shell 自动化,判断元素是否在该页面,进行点击测试

Linux 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

shell 自动化,判断元素是否在该页面,进行点击测试

#!/bin/bash
#uiautomator获取页面元素,元素是否在该页
ip134=10.66.209.151
adb connect $ip134
#mkdir ip132
adb -s $ip134 shell am start -n com.guoming.health.device.voiceskill/com.guoming.health.device.voiceskill.video.ui.ConstactsHomeActivity
function ip134()
{
#需要确保没有弹窗出现
adb -s $ip132 shell uiautomator dump /data/local/tmp/app.uix
#cd ip132/
sleep 3
adb -s $ip132 pull /data/local/tmp/app.uix
sleep 3
chmod 777 app.uix
sleep 3
text=cat app.uix|grep -ai "视频通话" |cut -c 10155-10166
text1=cat app.uix|grep -ai "视频通话" |cut -c 10160-10171
i=1
while [ i − l e 100 ] d o i f [ " i -le 100 ] do if [ " i−le100]doif["text" = “视频通话” ] ; then
echo “进入成功”
adb -s $ip132 shell input keyevent 21
adb -s $ip132 shell input keyevent 21
sleep 3
adb -s i p 132 s h e l l i n p u t k e y e v e n t 23 e l i f [ " ip132 shell input keyevent 23 elif [ " ip132shellinputkeyevent23elif["text1" = “视频通话” ] ; then
echo “进入成功2”
adb -s $ip132 shell input keyevent 21
adb -s $ip132 shell input keyevent 21
sleep 3
adb -s $ip132 shell input keyevent 23
else
echo $text
fi
sleep 3
#点击挂断
adb -s $ip132 shell input tap 512 486
done
}
ip134

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/681718.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号