请问sonic 和airtest结合,sonic 2.6.1 版本可以成功运行么? 我写的脚本,启动app后就一直不运行脚本,似乎是阻塞住了,请问有大佬知道如何解决么
from airtest.core.api import *
from poco.drivers.android.uiautomation import AndroidUiautomationPoco
import os
import sys
auto_setup(file)
def test_demo():
udId = sys.argv[1:][1]
session_id, adb_serial_num, global_pramas, uia_url = sys.argv[1:]
print(session_id, adb_serial_num, global_pramas, uia_url)
udId = adb_serial_num
print(“\n”)
print(udId)
os.system(“adb -s %s shell am force-stop io.appium.uiautomator2.server” % adb_serial_num)
os.system(“adb -s %s am force-stop io.appium.uiautomator2.server.test” % adb_serial_num)
sleep(3)
init_device(“Android”, uuid=adb_serial_num)
connect_device(“Android://127.0.0.1:5037/” + adb_serial_num)
poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
PKG = “com.taikanglife.isalessystem”
stop_app(PKG)
start_app(PKG)
sleep(4.0)
poco(“com.taikanglife.isalessystem:id/et_login_num”).click()
text(“01000052”)
sleep(4.0)
poco(“com.taikanglife.isalessystem:id/cb_login_yinsi”).click()
poco(“com.taikanglife.isalessystem:id/login”).click()
poco(“com.taikanglife.isalessystem:id/btn_validate_login”).click()
if name == ‘main’:
test_demo()