环境:
appium:1.10.0
xcode: 10.1
ios: 11.0

在 appium 客户端可以正常启动成功并展示,通过 python 脚本运行发现使用 driver.tap 会报 Unhandled endpoint 错误,改成 driver.execute_script("mobile: tap", {"x": 200, "y": 200}) 就可以正常执行了。
但是用 appcrawler 时也会报这个错,那在 appcrawler 中应该怎样改呢?

appcrawler 日志:

2019-12-10 11:40:32 INFO [AppCrawler$.86.main]

AppCrawler 2.4.0 [霍格沃兹测试学院特别纪念版]
Appium 1.8.1 Java8 tested
app 爬虫, 用于自动遍历测试. 支持 Android 和 iOS, 支持真机和模拟器
项目地址: https://github.com/seveniruby/AppCrawler
移动测试技术交流: https://testerhome.com
联络作者: seveniruby@testerhome.com (思寒)
致谢: 晓光 泉龙 杨榕 恒温 mikezhou yaming116 沐木


2019-12-10 11:40:32 INFO [AppCrawler$.223.parseParams] use default appium address 4723
2019-12-10 11:40:32 INFO [AppCrawler$.230.parseParams] appium address = Some(http://127.0.0.1:4723/wd/hub)
2019-12-10 11:40:32 INFO [AppCrawler$.242.parseParams] result directory = 20191210114031
2019-12-10 11:40:33 INFO [Crawler.130.start] set xpath attribute with List(name, label, value, resource-id, content-desc, instance, text)
2019-12-10 11:40:33 INFO [Crawler.135.start] set xpath
2019-12-10 11:40:33 INFO [Crawler.89.$anonfun$loadPlugins$2] com.testerhome.appcrawler.plugin.TagLimitPlugin@205b132e
2019-12-10 11:40:33 INFO [Crawler.89.$anonfun$loadPlugins$2] com.testerhome.appcrawler.plugin.ReportPlugin@719843e5
2019-12-10 11:40:33 INFO [Crawler.89.$anonfun$loadPlugins$2] com.testerhome.appcrawler.plugin.FreeMind@58112bc4
2019-12-10 11:40:33 INFO [TagLimitPlugin.19.init] com.testerhome.appcrawler.plugin.TagLimitPlugin init
2019-12-10 11:40:33 INFO [ReportPlugin.19.init] com.testerhome.appcrawler.plugin.ReportPlugin init
2019-12-10 11:40:33 INFO [FreeMind.19.init] com.testerhome.appcrawler.plugin.FreeMind init
2019-12-10 11:40:33 INFO [ReportPlugin.21.start] reportPath=/Users/llm/Desktop/appcrawler/20191210114031
2019-12-10 11:40:33 INFO [ReportPlugin.24.start] create /Users/llm/Desktop/appcrawler/20191210114031/tmp/ directory
2019-12-10 11:40:33 INFO [Crawler.138.start] prepare setup Appium
2019-12-10 11:40:33 INFO [Crawler.250.setupAppium] afterPageMax=2
2019-12-10 11:40:35 INFO [Crawler.273.setupAppium] use AppiumClient
2019-12-10 11:40:35 INFO [Crawler.274.setupAppium] Map(automationName -> XCUITest, platformVersion -> 11.0, udid -> 9e46a7affa856e4808dda85d51dfb374be7c8670, appium -> http://127.0.0.1:4723/wd/hub, noReset -> true, app -> /Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa, fullReset -> false)
十二月 10, 2019 11:40:43 上午 io.appium.java_client.remote.AppiumCommandExecutor$1 lambda$0
信息: Detected dialect: W3C
Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Unhandled endpoint: /session/7A81EE87-EDAC-4B0E-AC09-3912156595A9/wda/screen -- http://localhost:8100/ with parameters {
wildcards = (
"session/7A81EE87-EDAC-4B0E-AC09-3912156595A9/wda/screen"
);
}
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'llmdeMacBook-Air.local', ip: 'fe80:0:0:0:1484:e2b6:f264:3621%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.14.6', java.version: '1.8.0_212'
Driver info: io.appium.java_client.ios.IOSDriver
Capabilities {app: /Users/llm/Desktop/appcrawl..., appium: http://127.0.0.1:4723/wd/hub, automationName: XCUITest, browserName: , databaseEnabled: false, deviceName: demo, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: false, noReset: true, platform: MAC, platformName: iOS, platformVersion: 11.0, takesScreenshot: true, udid: 9e46a7affa856e4808dda85d51d..., webStorageEnabled: false}
Session ID: 28731a92-8ee1-472b-9019-6e78f090c575
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:231)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:46)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at io.appium.java_client.HasSessionDetails.getSessionDetails(HasSessionDetails.java:39)
at io.appium.java_client.HasSessionDetails.getSessionDetail(HasSessionDetails.java:56)
at io.appium.java_client.HasSessionDetails.getPlatformName(HasSessionDetails.java:65)
at io.appium.java_client.internal.JsonToMobileElementConverter.(JsonToMobileElementConverter.java:49)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:89)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:94)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:95)
at com.testerhome.appcrawler.driver.AppiumClient.appium(AppiumClient.scala:107)
at com.testerhome.appcrawler.driver.AppiumClient.(AppiumClient.scala:40)
at com.testerhome.appcrawler.Crawler.setupAppium(Crawler.scala:277)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:139)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:322)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:290)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:91)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

appium 日志:
[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"/Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa","appium":"http://127.0.0.1:4723/wd/hub,noReset:true,platformVersion:11.0,automationName:XCUITest,platformName:iOS,udid:9e46a7affa856e4808dda85d51dfb374be7c8670,deviceName:demo,fullReset:false},capabilities:{alwaysMatch:{appium:app:/Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa,appium:http://127.0.0.1:4723/wd/hub,appium:automationName:XCUITest,appium:deviceName:demo,appium:fullReset:false,appium:noReset:true,platformName:ios,appium:platformVersion:11.0,appium:udid:9e46a7affa856e4808dda85d51dfb374be7c8670},firstMatch:[{}]}"}
[W3C] Calling AppiumDriver.createSession() with args: [{"app":"/Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa","appium":"http://127.0.0.1:4723/wd/hub,noReset:true,platformVersion:11.0,automationName:XCUITest,platformName:iOS,udid:9e46a7affa856e4808dda85d51dfb374be7c8670,deviceName:demo,fullReset:false},null,{alwaysMatch:{appium:app:/Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa,appium:http://127.0.0.1:4723/wd/hub,appium:automationName:XCUITest,appium:deviceName:demo,appium:fullReset:false,appium:noReset:true,platformName:ios,appium:platformVersion:11.0,appium:udid:9e46a7affa856e4808dda85d51dfb374be7c8670},firstMatch:[{}]}"]
[BaseDriver] Event 'newSessionRequested' logged at 1575949236582 (11:40:36 GMT+0800 (CST))
[BaseDriver] The capabilities ["appium"] are not standard capabilities and should have an extension prefix
[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.
[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.
[Appium] Creating new XCUITestDriver (v2.104.0) session
[Appium] Capabilities:
[Appium] appium: http://127.0.0.1:4723/wd/hub
[Appium] platformName: ios
[Appium] app: /Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa
[Appium] automationName: XCUITest
[Appium] deviceName: demo
[Appium] fullReset: false
[Appium] noReset: true
[Appium] platformVersion: 11.0
[Appium] udid: 9e46a7affa856e4808dda85d51dfb374be7c8670
[BaseDriver] W3C capabilities {"alwaysMatch":{"appium:app... and MJSONWP desired capabilities {"app":"/Users/llm/Desktop/... were provided
[BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"appium:app...
[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.
[BaseDriver] Boolean capability passed in as string. Functionality may be compromised.
[BaseDriver] Capability 'noReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] Capability 'fullReset' changed from string to boolean. This may cause unexpected behavior
[BaseDriver] The following capabilities were provided, but are not recognized by appium: appium.
[BaseDriver] Session created with session id: 28731a92-8ee1-472b-9019-6e78f090c575
[XCUITest] Current user: 'llm'
[XCUITest] Available devices: 9e46a7affa856e4808dda85d51dfb374be7c8670
[XCUITest] Creating iDevice object with udid '9e46a7affa856e4808dda85d51dfb374be7c8670'
[XCUITest] Determining device to run tests on: udid: '9e46a7affa856e4808dda85d51dfb374be7c8670', real device: true
[XCUITest] Xcode version set to '10.1' (tools v10.1.0.0.1.1539992718)
[XCUITest] iOS SDK Version set to '12.1'
[BaseDriver] Event 'xcodeDetailsRetrieved' logged at 1575949236800 (11:40:36 GMT+0800 (CST))
[BaseDriver] Using local app '/Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa'
[BaseDriver] Will reuse previously cached application at '/var/folders/dp/4z0m4m2900g6c9_wm7smtz200000gn/T/20191110-6153-2xnatt.yahrp/Payload/Solar.app'
[BaseDriver] Event 'appConfigured' logged at 1575949238280 (11:40:38 GMT+0800 (CST))
[XCUITest] Checking whether app '/var/folders/dp/4z0m4m2900g6c9_wm7smtz200000gn/T/20191110-6153-2xnatt.yahrp/Payload/Solar.app' is actually present on file system
[XCUITest] App is present
[iOS] Getting bundle ID from app '/var/folders/dp/4z0m4m2900g6c9_wm7smtz200000gn/T/20191110-6153-2xnatt.yahrp/Payload/Solar.app': 'com.fenbi.solarinhouse'
[BaseDriver] Event 'resetStarted' logged at 1575949238282 (11:40:38 GMT+0800 (CST))
[XCUITest] Reset: fullReset not set. Leaving as is
[BaseDriver] Event 'resetComplete' logged at 1575949238283 (11:40:38 GMT+0800 (CST))
[iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog
[iOSLog] Starting iOS device log capture with: 'idevicesyslog'
[XCUITest] Crash reports root '/Users/llm/Library/Logs/CrashReporter/MobileDevice/iPhone' does not exist. Got nothing to gather.
[BaseDriver] Event 'logCaptureStarted' logged at 1575949238542 (11:40:38 GMT+0800 (CST))
[XCUITest] Setting up real device
[XCUITest] Verifying application platform
[XCUITest] CFBundleSupportedPlatforms: ["iPhoneOS"]
[XCUITest] App 'com.fenbi.solarinhouse' is already installed. No need to reinstall.
[BaseDriver] Event 'appInstalled' logged at 1575949238798 (11:40:38 GMT+0800 (CST))
[XCUITest] Using WDA path: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent'
[XCUITest] Using WDA agent: '/Applications/Appium.app/Contents/Resources/app/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj'
[XCUITest] No obsolete cached processes from previous WDA sessions listening on port 8100 have been found
[JSONWP Proxy] Matched '/status' to command name 'getStatus'
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.0\",\n \"ip\" : \"10.2.15.251\"\n },\n \"build\" : {\n \"time\" : \"Dec 10 2019 11:28:46\"\n }\n },\n \"sessionId\" : \"040E6895-4F80-424F-8B58-5CF8DC623965\",\n \"status\" : 0\n}"
[iProxy] recv failed: Connection reset by peer
[iProxy] recv failed: Operation not permitted
[XCUITest] Upgrade timestamp of the currently bundled WDA: 1575537739400
[XCUITest] Upgrade timestamp of the WDA on the device: undefined
[XCUITest] Will reuse previously cached WDA instance at 'http://localhost:8100/'. Set the wdaLocalPort capability to a value different from 8100 if this is an undesired behavior.
[XCUITest] Trying to start WebDriverAgent 1 times with 10000ms interval
[BaseDriver] Event 'wdaStartAttempted' logged at 1575949238871 (11:40:38 GMT+0800 (CST))
[XCUITest] Using provided WebdriverAgent at 'http://localhost:8100/'
[BaseDriver] Event 'wdaSessionAttempted' logged at 1575949238871 (11:40:38 GMT+0800 (CST))
[XCUITest] Sending createSession command to WDA
[JSONWP Proxy] Matched '/status' to command name 'getStatus'
[JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8100/status] with no body
[JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"state\" : \"success\",\n \"os\" : {\n \"name\" : \"iOS\",\n \"version\" : \"11.0\"\n },\n \"ios\" : {\n \"simulatorVersion\" : \"11.0\",\n \"ip\" : \"10.2.15.251\"\n },\n \"build\" : {\n \"time\" : \"Dec 10 2019 11:28:46\"\n }\n },\n \"sessionId\" : \"040E6895-4F80-424F-8B58-5CF8DC623965\",\n \"status\" : 0\n}"
[JSONWP Proxy] Matched '/session' to command name 'createSession'
[JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8100/session] with body: {"desiredCapabilities":{"bundleId":"com.fenbi.solarinhouse","arguments":[],"environment":{},"shouldWaitForQuiescence":true,"shouldUseTestManagerForVisibilityDetection":false,"maxTypingFrequency":60,"shouldUseSingletonTestManager":true}}
[iProxy] recv failed: Connection reset by peer
[iProxy] recv failed: Operation not permitted
[JSONWP Proxy] Got response with status 200: {"value":{"sessionId":"7A81EE87-EDAC-4B0E-AC09-3912156595A9","capabilities":{"device":"iphone","browserName":"小猿搜题公测版","sdkVersion":"11.0","CFBundleIdentifier":"com.fenbi.solarinhouse"}},"sessionId":"7A81EE87-EDAC-4B0E-AC09-3912156595A9","status":0}
[BaseDriver] Event 'wdaSessionStarted' logged at 1575949243494 (11:40:43 GMT+0800 (CST))
[BaseDriver] Event 'wdaStarted' logged at 1575949243495 (11:40:43 GMT+0800 (CST))
[XCUITest] Skipping setting of the initial display orientation. Set the "orientation" capability to either "LANDSCAPE" or "PORTRAIT", if this is an undesired behavior.
[BaseDriver] Event 'orientationSet' logged at 1575949243496 (11:40:43 GMT+0800 (CST))
[Appium] New XCUITestDriver session created successfully, session 28731a92-8ee1-472b-9019-6e78f090c575 added to master session list
[BaseDriver] Event 'newSessionStarted' logged at 1575949243497 (11:40:43 GMT+0800 (CST))
[W3C (28731a92)] Cached the protocol value 'W3C' for the new session 28731a92-8ee1-472b-9019-6e78f090c575
[W3C (28731a92)] Responding to client with driver.createSession() result: {"capabilities":{"webStorageEnabled":false,"locationContextEnabled":false,"browserName":"","platform":"MAC","javascriptEnabled":true,"databaseEnabled":false,"takesScreenshot":true,"networkConnectionEnabled":false,"platformName":"ios","appium":"http://127.0.0.1:4723/wd/hub,app:/Users/llm/Desktop/appcrawler/Solar_191111-1847_r43402b999.ipa,automationName:XCUITest,deviceName:demo,fullReset:false,noReset:true,platformVersion:11.0,udid:9e46a7affa856e4808dda85d51dfb374be7c8670}"}
[HTTP] <-- POST /wd/hub/session 200 6918 ms - 563
[HTTP]
[iProxy] recv failed: Connection reset by peer
[iProxy] recv failed: Operation not permitted
[HTTP] --> GET /wd/hub/session/28731a92-8ee1-472b-9019-6e78f090c575
[HTTP] {}
[W3C (28731a92)] Calling AppiumDriver.getSession() with args: ["28731a92-8ee1-472b-9019-6e78f090c575"]
[XCUITest] Executing command 'getSession'
[JSONWP Proxy] Matched '/' to command name 'getSession'
[JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8100/session/7A81EE87-EDAC-4B0E-AC09-3912156595A9] with no body
[iProxy] recv failed: Connection reset by peer
[iProxy] recv failed: Operation not permitted
[JSONWP Proxy] Got response with status 200: "{\n \"value\" : {\n \"sessionId\" : \"7A81EE87-EDAC-4B0E-AC09-3912156595A9\",\n \"capabilities\" : {\n \"device\" : \"iphone\",\n \"browserName\" : \"小猿搜题公测版\",\n \"sdkVersion\" : \"11.0\",\n \"CFBundleIdentifier\" : \"com.fenbi.solarinhouse\"\n }\n },\n \"sessionId\" : \"7A81EE87-EDAC-4B0E-AC09-3912156595A9\",\n \"status\" : 0\n}"
[JSONWP Proxy] Proxying [GET /wda/screen] to [GET http://localhost:8100/session/7A81EE87-EDAC-4B0E-AC09-3912156595A9/wda/screen] with no body
[JSONWP Proxy] Got response with status 200: "{\n \"value\" : \"Unhandled endpoint: \/session\/7A81EE87-EDAC-4B0E-AC09-3912156595A9\/wda\/screen -- http:\/\/localhost:8100\/ with parameters {\n wildcards = (\n \\"session\/7A81EE87-EDAC-4B0E-AC09-3912156595A9\/wda\/screen\\"\n );\n}\",\n \"sessionId\" : \"7A81EE87-EDAC-4B0E-AC09-3912156595A9\",\n \"status\" : 1\n}"
[MJSONWP] Matched JSONWP error code 1 to UnknownError
[iProxy] recv failed: Connection reset by peer
[iProxy] recv failed: Operation not permitted
[W3C (28731a92)] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Unhandled endpoint: /session/7A81EE87-EDAC-4B0E-AC09-3912156595A9/wda/screen -- http://localhost:8100/ with parameters {
[W3C (28731a92)] wildcards = (
[W3C (28731a92)] "session/7A81EE87-EDAC-4B0E-AC09-3912156595A9/wda/screen"
[W3C (28731a92)] );
[W3C (28731a92)] }
[W3C (28731a92)] at errorFromMJSONWPStatusCode (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/errors.js:789:10)
[W3C (28731a92)] at ProxyRequestError.getActualError (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/protocol/errors.js:683:14)
[W3C (28731a92)] at JWProxy.command (/Applications/Appium.app/Contents/Resources/app/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:234:19)
[HTTP] <-- GET /wd/hub/session/28731a92-8ee1-472b-9019-6e78f090c575 500 191 ms - 1131
[HTTP]


↙↙↙阅读原文可查看相关链接,并与作者交流