java 例子 MobileFindJavaTest.java 运行时报错,出错部分
public String scroll_to(String text) {
text = text.replaceAll("\"", "\\\""); // quotes must be escaped.
final String[] jsonString = {"\"scroll\"","[[3,\"" + text + "\"]]","[[7,\"" + text + "\"]]"};
return driver.complexFind(jsonString);
}
错误
info: Pushing command to appium work queue: ["find",{"strategy":"dynamic","selector":["\"scroll\"","[[3,\"About phone\"]]","[[7,\"About phone\"]]"],"context":"","multiple":false}]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"find","params":{"strategy":
"dynamic","selector":["\"scroll\"","[[3,\"About phone\"]]","[[7,\"About phone\"]]"],"context":"","multiple":false}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: find
info: [BOOTSTRAP] [debug] Finding dynamic.
info: [BOOTSTRAP] [debug] Returning all? false
info: [BOOTSTRAP] [debug] Scrolling? false
info: [BOOTSTRAP] [debug] ["\"scroll\"","[[3,\"About phone\"]]","[[7,\"About phone\"]]"]
info: [BOOTSTRAP] [debug] Parsing selector 0
info: [BOOTSTRAP] [info] Returning result: {"value":"java.lang.String cannot be cast to org.json.JSONArray","status":13}
info: Pushing command to appium work queue: ["find",{"strategy":"dynamic","selector":["\"scroll\"","[[3,\"About phone\"]]","[[7,\"About phone\"]]"],"context":"","multiple":false}]
info: [BOOTSTRAP] [info] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"dynamic","selector":["\"scroll\"","[[3,\"About phone\"]]","[[7,\"About phone\"]]"],"context":"","mu
ltiple":false}}
info: [BOOTSTRAP] [info] Got command of type ACTION
info: [BOOTSTRAP] [debug] Got command action: find
info: Responding to client with error: {"status":13,"value":{"message":"An unknown server-side error occurred while processing the command.","origValue":"java.lang.String cannot be cast to org.json.JSONArray"},"sessionId":"e9328838-a82c-46c8-a0f2-6c3b2ba70a2f"}
POST /wd/hub/session/e9328838-a82c-46c8-a0f2-6c3b2ba70a2f/appium/app/complex_find 500 20379ms - 250b