请先选择
<!--
求求了!帮帮忙!花费30秒不到的时间填写一下以下信息,真的求求了。不填写模板无法审核。标题也补上版本号
-->
问题描述:自定义groovy脚本,运行报错No signature of method
Server版本:2.3.2
Agent版本与部署方式:2.3.2
手机型号与系统版本:华为mate40 Pro,鸿蒙3.0
截图:
代码:
import org.cloud.sonic.agent.common.models.HandleContext;
targetEle = null;
n=1;
HandleContext handleContext = new HandleContext();
while (targetEle == null) {
androidStepHandler.swipeByDefinedDirection(handleContext,"up",300);
androidStepHandler.log.sendStepLog(StepType.INFO, "", "滑动屏幕次数:" + n);
try {
targetEle = androidStepHandler.findEle("xpath","//android.widget.TextView[@text='凯叔西游记全集']").getText();
} catch (Exception e) {
handleContext.setE(e);
}
n++;
if (n>5){
break;
}
}
相关日志:
异常信息: groovy.lang.MissingMethodException: No signature of method: org.cloud.sonic.agent.tests.handlers.AndroidStepHandler.swipeByDefinedDirection() is applicable for argument types: (org.cloud.sonic.agent.common.models.HandleContext, String, Integer) values: [HandleDes{stepDes='', detail='', e=null}, up, 300]
如果是开发环境,请加上【开发环境】标签标签