First, the problem: Using eclipse to run test cases, report the following error
socket write error
at java.net.SocketOutputStream.socketWrite0(local method)
at java.net.SocketOutputStream.socketWrite(unknown source)
at java.net.SocketOutputStream.write(unknown source)
at sun.nio.cs.StreamEncoder. writeBytes(unknown source)
at sun.nio. css . streamencoder. implFlushBuffer(unknown source)
at sun.nio. ces . streamencoder. implFlush(Unknown Source)
StreamEncoder. Refresh at java.io.OutputStreamWriter (unknown source).
. BufferedWriter at java.io.
. Flushing (unknown source)
org.testng.remote.strprotocol.JsonMessageSender.sendMessage (JsonMessageSender.java: 41)
org.testng.remote.strprotocol.MessageHub.sendMessage (MessageHub.java: 42)
org.testng.remote.strprotocol.RemoteTestListener1.onTestStart (RemoteTestListener1.java: 49)
org.testng.internal.Invoker.runTestListeners (Invoker.java: 1904)
org.testng.internal.Invoker.runTestListeners (Invoker.java: 1879)
org.testng.internal.Invoker.invokeMethod (Invoker.java: 685)
org.testng.internal.Invoker.invokeTestMethod (Invoker.java: 901)
org.testng.internal.Invoker.invokeTestMethods (Invoker.java: 1231)
org.testng.internal.TestMethodWorker.invokeTestMethods (TestMethodWorker.java: 127)
org.testng.internal.TestMethodWorker.run (TestMethodWorker.java: 111)在org.testng.TestRunner.privateRun
(TestRunner.java: 767)org.testng.TestRunner.run (TestRunner.java: 617)
org.testng.SuiteRunner.runTest (SuiteRunner.java: 334)
org.testng.SuiteRunner.runSequentially (SuiteRunner.java: 329)
org.testng.SuiteRunner.privateRun (SuiteRunner.java: 291)
org.testng.SuiteRunner.run (SuiteRunner.java: 240)
org.testng.SuiteRunnerWorker.runSuite (SuiteRunnerWorker.java: 52)在org.testng.SuiteRunnerWorker.run
(SuiteRunnerWorker.java: 86)org.testng.TestNG.runSuitesSequentially (TestNG.java: 1198)
org.testng.TestNG.runSuitesLocally (TestNG.java: 1123)
org.testng.TestNG.run (TestNG.java: 1031)
org.testng.remote.AbstractRemoteTestNG.run (AbstractRemoteTestNG.java: 114)
org.testng.remote.RemoteTestNG.initAndRun (RemoteTestNG.java: 251)
org.testng.remote.RemoteTestNG.main (RemoteTestNG.java: 77)
[SeleniumAutoConsole]
Information [Main] com.cases.KfglTest.kfgl_0001_LoginSucc | (36) kfgl_0001_LoginSucc Run!
[SeleniumAutoConsole] info [main] com.cases.KfglTest.kfgl_0001_LoginSucc(40) | decibels –:zhangsan
Database result is: zhangsan// there are two data, the English data read correctly, the Chinese data read failed
SocketException:Software cause connection broken: socket write error
at java.net.SocketOutputStream.socketWrite0(local method)
at java.net.SocketOutputStream.socketWrite(unknown source)
at java.net.SocketOutputStream.write(unknown source)
at sun.nio. css . streamencoder. writeBytes(unknown source)
at sun.nio. css . streamencoder. implFlushBuffer(unknown source)
at sun.nio. ces . streamencoder. implFlush(Unknown Source)
StreamEncoder. Refresh at java.io.OutputStreamWriter (unknown source).
. BufferedWriter at java.io.
. Flushing (unknown source)
Translated with www.DeepL.com/Translator (free version)
org.testng.remote.strprotocol.JsonMessageSender.sendMessage (JsonMessageSender.java: 41)
org.testng.remote.strprotocol.MessageHub.sendMessage (MessageHub.java: 42)
org.testng.remote.strprotocol.RemoteTestListener1.onTestSuccess (RemoteTestListener1.java: 88)
org.testng.internal.Invoker.runTestListeners (Invoker.java: 1899)
org.testng.internal.Invoker.runTestListeners (Invoker.java: 1879)
org.testng.internal.Invoker.invokeMethod (Invoker.java: 778)
org.testng.internal.Invoker.invokeTestMethod (Invoker.java: 901)
org.testng.internal.Invoker.invokeTestMethods (Invoker.java: 1231)
org.testng.internal.TestMethodWorker.invokeTestMethods (TestMethodWorker.java: 127)
org.testng.internal.TestMethodWorker.run (TestMethodWorker.java: 111)在org.testng
II. Causes of the problem
Test data containing Chinese
III. Solutions
eclipse modify. ini, set system properties to utf – 8
-Dfile.encoding = utf – 8
Read More:
- [Solved] Multithreading uses jsch to obtain a session for connection error: session.connect: java.net.socketexception: connection reset
- [Solved] Tomcat configurate HTTPS error: java.net.SocketException: Permission denied
- [Solved] port (127.0.0.1:64444): java.net.SocketException “Interrupted function call: accept failed“
- [Solved] failed on connection exception: java.net.ConnectException: Connection denied
- [Solved] Hadoop failed on connection exception: java.net.ConnectException: Connection refused
- [Solved] Error: caused by: java.net.bindexception: the address is already in use
- [Solved] hadoop Error: 9000 failed on connection exception java.net.ConnectException Denied to Access
- Java.sql.sqlexception: unable to read more data from socket
- [Solved] openstack4j Startup Error: java.net.UnknownHostException: controller
- Caused by: java.lang.IllegalStateException (How to Fix)
- [Solved] fasterxml ToStringSerializerBase Error: Caused by: java.lang.NoClassDefFoundError…
- [Solved] kafka Error: java.net.UnknownHostException: ls-bptysztw
- The java springboot websocket service server actively closes the connection and causes java.io.EOFException to be thrown
- [Solved] kafka Error: java.net.UnknownHostException: kafkahost
- JAVA Error Illegal access: this web application instance has been stopped already. Could not load net.sf
- Error resolution: Handler dispatch failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/Datatype
- jemter java.net.BindException:Address alreardy in use [How to Solve]
- IntelliJ idea error: e rror:java : invalid source distribution: 11 problem resolution
- [Solved] canal Startup Error: error while reading from client socket java.io.IOException: Received error packet:
- [Solved] ClientAbortException: java.io.IOException: Connection reset by peer