运行中日志报错问题:请教咨询老师们,运行中的日志报错Screen shot has been taken和An unknown server-side error occurred while processing the command. Original error: socket hang up

实际运行过程中间经常会出现下面的报错日志,影响报告截图、和中途终止,需要重新开始执行的情况,麻烦大佬帮忙看一下,是否是参数配置或是其他问题导致

日志报错问题1:

2021-11-10 11:47:38 INFO [Log.1194.$anonfun$saveScreen$2] ui change screenshot again
2021-11-10 11:47:38 ERROR [Log.277.handleException] org.openqa.selenium.remote.ScreenshotException: Screen shot has been taken

日志报错问题2:
2021-11-17 15:51:02 INFO [ReactWebDriver.46.findElement] find by xpath success
2021-11-17 15:51:02 INFO [Crawler.1141.$anonfun$doElementAction$3] click element
2021-11-17 15:51:02 INFO [Crawler.1171.doElementAction] afterAllRetry = 0 because of last action not equal to after
2021-11-17 15:51:02 INFO [Crawler.1175.doElementAction] sleep 2000 ms
2021-11-17 15:51:04 INFO [Crawler.778.afterElementAction] mark image exist
2021-11-17 15:51:04 INFO [Crawler.1229.saveScreen] start screenshot
2021-11-17 15:51:04 INFO [Crawler.1234.$anonfun$saveScreen$2] ui change screenshot again
2021-11-17 15:51:04 ERROR [LogicUtils$.13.handleException] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘11’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: LIO-AN00, deviceName: 127.0.0.1:62001, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, statBarHeight: 48, takesScreenshot: true, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 5c64ebf2-d71e-4ddd-8c09-a6e3093d7ba6
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$.$anonfun$asyncTask$1(LogicUtils.scala:50)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.util.Try$.apply(Try.scala:210)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$.asyncTask(LogicUtils.scala:41)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.saveScreen(Crawler.scala:1233)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.afterElementAction(Crawler.scala:790)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.crawl(Crawler.scala:1039)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.$anonfun$crawlWithRetry$1(Crawler.scala:207)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.util.Try$.apply(Try.scala:210)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.crawlWithRetry(Crawler.scala:207)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:170)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:323)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:290)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:81)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
2021-11-17 15:51:04 ERROR [LogicUtils$.16.handleException] find more cause
2021-11-17 15:51:04 ERROR [LogicUtils$.13.handleException] An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘11’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: LIO-AN00, deviceName: 127.0.0.1:62001, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, statBarHeight: 48, takesScreenshot: true, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 5c64ebf2-d71e-4ddd-8c09-a6e3093d7ba6
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:45)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.RemoteWebDriver.getScreenshotAs(RemoteWebDriver.java:295)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.SeleniumDriver.screenshot(SeleniumDriver.scala:70)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.$anonfun$saveScreen$2(Crawler.scala:1235)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$$anon$1.call(LogicUtils.scala:44)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.lang.Thread.run(Thread.java:834)
2021-11-17 15:51:04 ERROR [LogicUtils$.18.handleException] exception finish
2021-11-17 15:51:04 ERROR [Crawler.1243.saveScreen] screenshot error
2021-11-17 15:51:04 ERROR [Crawler.1244.saveScreen] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘11’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: LIO-AN00, deviceName: 127.0.0.1:62001, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, statBarHeight: 48, takesScreenshot: true, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 5c64ebf2-d71e-4ddd-8c09-a6e3093d7ba6
2021-11-17 15:51:04 INFO [Crawler.690.refreshPage] refresh page
2021-11-17 15:51:04 INFO [ReactWebDriver.91.getPageSourceWithRetry] start to get page source from appium
2021-11-17 15:51:04 ERROR [LogicUtils$.13.handleException] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘11’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: LIO-AN00, deviceName: 127.0.0.1:62001, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, statBarHeight: 48, takesScreenshot: true, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 5c64ebf2-d71e-4ddd-8c09-a6e3093d7ba6
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.FutureTask.get(FutureTask.java:205)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$.$anonfun$asyncTask$1(LogicUtils.scala:50)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.util.Try$.apply(Try.scala:210)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$.asyncTask(LogicUtils.scala:41)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.ReactWebDriver.$anonfun$getPageSourceWithRetry$1(ReactWebDriver.scala:96)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:190)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.ReactWebDriver.getPageSourceWithRetry(ReactWebDriver.scala:95)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.refreshPage(Crawler.scala:691)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.afterElementAction(Crawler.scala:792)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.crawl(Crawler.scala:1039)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.$anonfun$crawlWithRetry$1(Crawler.scala:207)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.util.Try$.apply(Try.scala:210)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.crawlWithRetry(Crawler.scala:207)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:170)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:323)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:290)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:81)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
2021-11-17 15:51:04 ERROR [LogicUtils$.16.handleException] find more cause
2021-11-17 15:51:04 ERROR [LogicUtils$.13.handleException] An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘11’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4723/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: LIO-AN00, deviceName: 127.0.0.1:62001, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62001, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, statBarHeight: 48, takesScreenshot: true, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 5c64ebf2-d71e-4ddd-8c09-a6e3093d7ba6
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:250)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:552)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:45)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] org.openqa.selenium.remote.RemoteWebDriver.getPageSource(RemoteWebDriver.java:438)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.AppiumClient.getPageSource(AppiumClient.scala:233)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.ReactWebDriver.$anonfun$getPageSourceWithRetry$2(ReactWebDriver.scala:96)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$$anon$1.call(LogicUtils.scala:44)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
2021-11-17 15:51:04 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.base/java.lang.Thread.run(Thread.java:834)
2021-11-17 15:51:04 ERROR [LogicUtils$.18.handleException] exception finish
2021-11-17 15:51:04 ERROR [ReactWebDriver.131.$anonfun$getPageSourceWithRetry$1] get page source error
2021-11-17 15:51:04 ERROR [ReactWebDriver.132.$anonfun$getPageSourceWithRetry$1] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’

报错日志.txt (68.3 KB)

别把所有的问题放一个帖子里讨论。

你的第二个问题是你的appium没管理好session吧,appium自己终止导致的。你可以通过appium --sessionoverride的方式去避免

好的,我把不同的问题分开。
第二个报错日志的解决 办法:appium-desk桌面版的 去appium安装目录下 命令行执行 appium -a 127.0.0.1 -p 4723 --session-override命令,覆盖之前的session
或者增加参数 capabilities.setCapability("sessionOverride ", true)
我试试看

试过了没

试过了,日志报错2好像也和我电脑的代理有关,关闭代理,运行了几次没有再出现那个session的报错。感谢 ~

思寒 老师,关于全局断言:有没有封装的 可以判断界面中所有元素 不存在 某一文字的 方法?
目前使用contains or 感觉需要枚举全部很容易遗漏和不准。

在assertGlobal里直接加contains语句是可以的。遗漏和不准是啥意思,我没明白

目的:contains断言不同模块菜单界面,需要列举所有界面的文字校验contains() or contains()…。我想反向操作只断言报错、异常的文字,如果界面没有这些异常,那就是正常。
现状:在freeformatter测试用not contains的方式,发现不可行,全部元素都满足所以都是成功。不是我想要实现的效果。
设想:通过getPageSource().contains(异常)==false这种判断执行结果为P的方式, 好像不支持getPageSource()函数,想请教下思寒老师,有没有封装的其他校验整个界面元素不包含异常、报错信息的方法??

//*[not(contains(@text, “失败”))] 不就行了?

//*[not(contains(@text, “失败”))] 我试着是不行的,这样的执行结果是全成功,每个界面dom所有元素列表中满足这个不包含的条件有好多,所以断言结果都是P。

我觉得需求你描述的不清楚,其他页面不包含异常,本来没问题就应该是正确的吧。

=======screenshot error======= Could not proxy. Proxy error: ========
@ 思寒老师,配置sessionOverride: "true"参数后,我这边运行过程还是偶现这个报错,能帮忙看下是什么原因导致的吗?

An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up

报错日志如下:

2021-11-22 19:55:41 INFO [LogicUtils$.66.asyncTask] use time 60.003 seconds name=screenshot result=error
2021-11-22 19:55:41 ERROR [LogicUtils$.73.asyncTask] 60 seconds timeout
2021-11-22 19:55:41 ERROR [Crawler.1245.saveScreen] screenshot error
2021-11-22 19:55:41 ERROR [Crawler.1246.saveScreen] null
2021-11-22 19:55:41 INFO [Crawler.692.refreshPage] refresh page
2021-11-22 19:55:41 INFO [ReactWebDriver.91.getPageSourceWithRetry] start to get page source from appium

2021-11-22 19:56:08 INFO [LogicUtils$.66.asyncTask] use time 26.437 seconds name=getPageSource result=error
2021-11-22 19:56:08 ERROR [LogicUtils$.13.handleException] org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_151’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4733/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4733/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62025, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2, sessionOverride: true, udid: 127.0.0.1:62025}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: TAS-AN00, deviceName: 127.0.0.1:62025, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62025, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, sessionOverride: true, statBarHeight: 48, takesScreenshot: true, udid: 127.0.0.1:62025, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 92786c63-e5a5-4bb1-b713-4a38c61bc7bc
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.util.concurrent.FutureTask.report(FutureTask.java:122)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.util.concurrent.FutureTask.get(FutureTask.java:206)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$.$anonfun$asyncTask$1(LogicUtils.scala:50)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.util.Try$.apply(Try.scala:210)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.utils.LogicUtils$.asyncTask(LogicUtils.scala:41)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.ReactWebDriver.$anonfun$getPageSourceWithRetry$1(ReactWebDriver.scala:96)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.collection.immutable.Range.foreach$mVc$sp(Range.scala:190)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.driver.ReactWebDriver.getPageSourceWithRetry(ReactWebDriver.scala:95)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.refreshPage(Crawler.scala:693)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.afterElementAction(Crawler.scala:794)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.crawl(Crawler.scala:1041)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.$anonfun$crawlWithRetry$1(Crawler.scala:207)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] scala.util.Try$.apply(Try.scala:210)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.crawlWithRetry(Crawler.scala:207)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.core.Crawler.start(Crawler.scala:170)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:323)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:290)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler$.main(AppCrawler.scala:81)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] com.ceshiren.appcrawler.AppCrawler.main(AppCrawler.scala)
2021-11-22 19:56:08 ERROR [LogicUtils$.16.handleException] find more cause
2021-11-22 19:56:08 ERROR [LogicUtils$.13.handleException] An unknown server-side error occurred while processing the command. Original error: Could not proxy. Proxy error: Could not proxy command to the remote server. Original error: socket hang up
Build info: version: ‘unknown’, revision: ‘unknown’, time: ‘unknown’
System info: host: ‘PC-HZ20127903’, ip: ‘10.10.66.56’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_151’
Driver info: io.appium.java_client.android.AndroidDriver
Capabilities {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4733/wd/hub, automationName: uiautomator2, databaseEnabled: false, desired: {app: , appActivity: hik.ebg.finance.MainActivity, appPackage: hik.ebg.finance, appium: http://127.0.0.1:4733/wd/hub, automationName: uiautomator2, deviceName: 127.0.0.1:62025, dontStopAppOnReset: false, fullReset: false, newCommandTimeout: 120, noReset: false, platformName: android, platformVersion: 7.1.2, sessionOverride: true, udid: 127.0.0.1:62025}, deviceApiLevel: 25, deviceManufacturer: HUAWEI, deviceModel: TAS-AN00, deviceName: 127.0.0.1:62025, deviceScreenDensity: 320, deviceScreenSize: 900x1600, deviceUDID: 127.0.0.1:62025, dontStopAppOnReset: false, fullReset: false, javascriptEnabled: true, locationContextEnabled: false, networkConnectionEnabled: true, newCommandTimeout: 120, noReset: false, pixelRatio: 2, platform: LINUX, platformName: Android, platformVersion: 7.1.2, sessionOverride: true, statBarHeight: 48, takesScreenshot: true, udid: 127.0.0.1:62025, viewportRect: {height: 1552, left: 0, top: 48, width: 900}, warnings: {}, webStorageEnabled: false}
Session ID: 92786c63-e5a5-4bb1-b713-4a38c61bc7bc
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2021-11-22 19:56:08 ERROR [LogicUtils$.14.$anonfun$handleException$1] java.lang.reflect.Constructor.newInstance(Constructor.java:423)

======proxy hang up 报错问题=========
说是uiautomator2版本不对&&或者其他appium所属App占用端口导致,我试试看