java-client6.0.0BEAT-4 升级为 6.0.0 正式版
server1.7.2 升级为 1.8.0(服务器不升级不会出现以下异常)

升级后直接执行出现:

Exception in thread "Thread-31" java.lang.NoClassDefFoundError: javax/websocket/DeploymentException
at io.appium.java_client.android.ListensToLogcatMessages.(ListensToLogcatMessages.java:34)
at com.appium.Driver.(Driver.java:74)
at com.task.SceneTask.initDriver(SceneTask.java:211)
at com.task.SceneTask.runScene(SceneTask.java:150)
at com.task.SceneTask.runTask(SceneTask.java:129)
at com.task.TaskRunner.runTask(TaskRunner.java:98)
at com.viwer.scenetask.MainTaskUI$StartTaskThread.run(MainTaskUI.java:361)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.lang.ClassNotFoundException: javax.websocket.DeploymentException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
... 8 more

增加依赖包 websocket-api.jar 后,在执行 driver.getPageSource() 方法时出现

org.openqa.selenium.WebDriverException: java.net.SocketException: Connection reset
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:03.216Z'
System info: host: 'autodeMac-mini.local', ip: '10.1.5.179', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.2', java.version: '10.0.1'
Driver info: driver.version: RemoteWebDriver
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:233)
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.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.getPageSource(RemoteWebDriver.java:429)
at com.helper.AndroidInfo.getPageSource(AndroidInfo.java:689)
at com.helper.AndroidInfo.waitForNewWindow(AndroidInfo.java:649)
at com.appium.AndroidOp.findElementBy(AndroidOp.java:280)
at com.appium.AndroidOp.HandlePermission(AndroidOp.java:930)
at com.test.android.ver900.General.skipGuide(General.java:65)
at com.test.android.ver900.单项测试.快速检查 (单项测试.java:92)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at com.task.FactoryScene.RunTest(FactoryScene.java:173)
at com.task.SceneTask.runScene(SceneTask.java:158)
at com.task.SceneTask.runTask(SceneTask.java:129)
at com.task.TaskRunner.runTask(TaskRunner.java:98)
at com.viwer.scenetask.MainTaskUI$StartTaskThread.run(MainTaskUI.java:361)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.net.SocketException: Connection reset
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:210)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:141)
at okio.Okio$2.read(Okio.java:139)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:345)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:217)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:212)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:105)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:155)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:218)
... 21 more

求助......


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