Closed yuanjie111 closed 4 years ago
This is the translated issue:
Macaca Version : 2.2.0
Macaca Doctor Logs : macaca-doctor version: 2.0.18
Node.js checklist:
node env: C: \ Program Files \ nodejs \ node.exe node version: v8.9.2
Android checklist:
JAVA version is 1.8
JAVA_HOME is set to C: \ Program Files \ Java \ jdk1.8.0_121
ANDROID_HOME is set to C: \ android-sdk
Platforms is set to C: \ android-sdk \ platforms \ android-28
ADB tool is set to C: \ android-sdk \ platform-tools \ adb.exe
GRADLE_HOME is set to D: \ gradle \ gradle-4.6-all \ gradle-4.6
Operate System : windows
Programming Language : nodejs
method: POST url: / wd / hub / session / f1a10791-4bf3-49a3-8ccb-1121f5f3266a / actions, jsonBody: { "actions": [{ "fromX": 118, "fromY": 1667, "toX": 118, "toY": 1167, "duration": 1, "steps": 100, "type": " drag "}]}
Call the method: this.touch ( 'drag', { // element central point fromX: x, fromY: y, // target coordinates toX, toY, // duration duration: 1, // duration: 1, steps: 100 }). Then (resolve) }
try use adb command ........
可以先用 adb命令解决这个问题。
// adb 拖动 命令
String cmdString = "adb shell input swipe"+ " " + x + " "+ y + " " + fX + " "+ fY;
BaseUtils.exec2(cmdString);
This is the translated issue comment: @houseshi
This problem can be resolved with the adb command.
// adb command drag String cmdString = "adb shell input swipe" + "" + x + "" + y + "" + fX + "" + fY; BaseUtils.exec2 (cmdString);
Macaca Version: 2.2.0
Macaca Doctor Logs: macaca-doctor version: 2.0.18
Node.js checklist:
node env: C:\Program Files\nodejs\node.exe node version: v8.9.2
Android checklist:
JAVA version is
1.8
JAVA_HOME is set toC:\Program Files\Java\jdk1.8.0_121
ANDROID_HOME is set toC:\android-sdk
Platforms is set toC:\android-sdk\platforms\android-28
ADB tool is set toC:\android-sdk\platform-tools\adb.exe
GRADLE_HOME is set toD:\gradle\gradle-4.6-all\gradle-4.6
Operate System: windows
Programming Language: nodejs
method: POST url: /wd/hub/session/f1a10791-4bf3-49a3-8ccb-1121f5f3266a/actions, jsonBody: {"actions":[{"fromX":118,"fromY":1667,"toX":118,"toY":1167,"duration":1,"steps":100,"type":"drag"}]}
调用方法: this.touch('drag',{ // 元素中心点 fromX: x, fromY: y, // 目标坐标 toX, toY, // 时长 duration: 1, // duration:1, steps:100 }).then(resolve) }