function Login_Mobile(){
target.frontMostApp().tabBar().buttons()["我的淘宝"].tap();
if(target.frontMostApp().navigationBar().rightButton().name()=="登录"){
target.frontMostApp().mainWindow().tableViews()["空列表"].cells()[0].tapWithOptions({tapOffset:{x:0.92, y:0.57}});//清空登录时,帐号的输入框
target.frontMostApp().keyboard().typeString("13600527882");
target.frontMostApp().mainWindow().tableViews()["空列表"].cells()["密 码:"].tap();
target.frontMostApp().keyboard().typeString("test1234");
target.frontMostApp().navigationBar().buttons()["登录"].tap();
}
else{
target.frontMostApp().navigationBar().buttons()["bar button refresh"].tap();
target.frontMostApp().navigationBar().buttons()["bar button refresh"].tap();
target.frontMostApp().mainWindow().tableViews()["空列表"].buttons()["mytaobao setting"].tap();
target.frontMostApp().mainWindow().tableViews()[0].cells()["注销当前帐号"].tap();
target.frontMostApp().actionSheet().buttons()["确定"].tap();
/*
target.frontMostApp().tabBar().buttons()["我的淘宝"].tap();
target.frontMostApp().mainWindow().tableViews()["空列表"].buttons()["mytaobao setting"].tap();
target.frontMostApp().mainWindow().buttons()[0].tap();
target.frontMostApp().mainWindow().tableViews()["空列表"].buttons()["mytaobao setting"].tap();
target.frontMostApp().mainWindow().tableViews()[0].cells()["注销当前帐号"].tap();
target.tap({x:492.00, y:377.00});
target.tap({x:477.00, y:401.00});
target.tap({x:506.00, y:391.00});
target.tap({x:516.00, y:393.00});
target.tap({x:515.00, y:394.00});
target.frontMostApp().actionSheet().buttons()["取消"].tap();
target.frontMostApp().navigationBar().buttons()["退出登录"].tap();
target.frontMostApp().actionSheet().buttons()["确定"].tap();
target.frontMostApp().mainWindow().tableViews()["空列表"].cells()[0].tapWithOptions({tapOffset:{x:0.92, y:0.57}});//清空登录时,帐号的输入框
target.frontMostApp().keyboard().typeString("13600527882");
target.frontMostApp().mainWindow().tableViews()["空列表"].cells()["密 码:"].secureTextFields()[0].tap();
target.frontMostApp().keyboard().typeString("test1234");
target.frontMostApp().navigationBar().buttons()["登录"].tap();
*/
}
target.frontMostApp().tabBar().buttons()["首页"].tap();
}
var target = UIATarget.localTarget();
Login_Mobile();
simple test code
最新推荐文章于 2023-07-14 11:57:46 发布