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

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

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()
{
#需要确保没有d窗出现
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

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/zaji/5682295.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-12-17
下一篇2022-12-17

发表评论

登录后才能评论

评论列表(0条)

    保存