#!/bin/bash
#uiautomator获取页面元素,元素是否在该页,判断进行点击事件测试
ip151=10.66.209.151
#mkdir ip132
#adb -s $ip134 shell am start -n com.guoming.health.device.voiceskill/com.guoming.health.device.voiceskill.video.ui.ConstactsHomeActivity
echo “输入1为刷卡模式”
echo “输入2为手机号”
echo “输入3为极简模式”
read -p “请您输入1-6任意字符:” NUM
ip=D66PFEVWSWAYH6EM
function card()
{
#刷卡模式
adb -s $ip shell uiautomator dump /data/local/tmp/app.uix
#cd ip132/
if [ $? -ne 0 ]; then
echo “fail”
else
#adb pull /data/local/tmp/app.uix
#text=cat app.uix|grep -ai "请刷卡获取号码" |cut -c 2992-3012
text=adb -s $ip shell cat /data/local/tmp/app.uix|grep -ai "请刷卡获取号码" |cut -c 2992-3012
if [ “$text” = “请刷卡获取号码” ] ; then
echo “进入成功”
adb -s $ip shell input text 1111111111111111111111111111111111111111111111111
#诊前检查页面,确认用户信息后,点击开始检测,调用zhenqiancheck函数
zhenqiancheck
else
echo $text fail
fi
fi
}
function phonenumber()
{
#手机号模式
adb -s $ip shell uiautomator dump /data/local/tmp/app.uix
if [ $? -ne 0 ]; then
echo “fail”
else
#adb pull /data/local/tmp/app.uix
#text=cat app.uix|grep -ai "请输入您的手机号" |cut -c 4880-4903
text=adb -s $ip shell cat /data/local/tmp/app.uix|grep -ai "请输入您的手机号" |cut -c 4880-4903
if [ “$text” = “请输入您的手机号” ] ; then
echo “进入成功”
adb -s $ip shell input text 15195899250
#诊前检查页面,确认用户信息后,点击开始检测,调用zhenqiancheck函数
else
echo $text fail
fi
fi
}
function jijian()
{
#极简模式
adb -s $ip shell uiautomator dump /data/local/tmp/app.uix
if [ $? -ne 0 ]; then
echo “fail”
else
#adb pull /data/local/tmp/app.uix
#text=cat app.uix |cut -c 3302-3319|grep -ai "中医舌脉检查"
text=adb -s $ip shell cat /data/local/tmp/app.uix |cut -c 3302-3319|grep -ai "中医舌脉检查"
if [ “$text” = “中医舌脉检查” ] ; then
echo “进入成功”
adb -s $ip shell input tap 512 314
else
echo $text fail
fi
fi
}
function zhenqiancheck()
{
#诊前检查页面,确认用户信息后,点击开始检测
sleep 5
adb -s $ip shell uiautomator dump /data/local/tmp/app.uix
if [ $? -ne 0 ]; then
echo “fail”
else
text=adb -s $ip shell cat /data/local/tmp/app.uix |cut -c 6016-6027|grep -ai "开始检测"
if [ “$text” = “开始检测” ] ; then
echo “进入成功”
adb -s $ip shell input tap 512 520
else
echo $text fail
fi
fi
}
function gangliefuzheng()
{
#问卷肛裂复诊
i=1
#while [ $i -le 4 ]
#do
adb -s i p s h e l l u i a u t o m a t o r d u m p / d a t a / l o c a l / t m p / a p p . u i x i f [ " ip shell uiautomator dump /data/local/tmp/app.uix if [ " ipshelluiauto
问卷点击题目提交答案
于 2022-01-11 11:33:01 首次发布