When sending API requests through the Web/API service, I’m able to send around 70 without issue. The data values are being read from a CSV file. However, after those 70, I receive the error:
Unable to send request (Root cause: java.net.SocketException: Socket closed
For each request.
The original 60+ request go through each run without incident. I was able to use the Postman Runner and sent 100 tests to the same API without incident. Each test was a pass with no failures.
2019-04-01 14:53:52.384 DEBUG testcase.Postman Request - 5: resp = req.buildPostApiRequestDataDriven(order_id, customer_number, branch_number, tier_code, unit_measure)
2019-04-01 14:53:52.388 INFO c.k.k.core.util.BrowserMobProxyManager - HAR: /Users/<>/Katalon Studio/Postman Testing/Reports/Postman Data Driven/20190401_145129/requests/main/78.har
2019-04-01 14:53:52.389 ERROR c.k.k.core.keyword.internal.KeywordMain - ❌ Unable to send request (Root cause: java.net.SocketException: Socket closed
at com.kms.katalon.core.webservice.common.RestfulClient.sendRequest(RestfulClient.java:80)
at com.kms.katalon.core.webservice.common.RestfulClient.send(RestfulClient.java:49)
at com.kms.katalon.core.webservice.keyword.builtin.SendRequestKeyword$_sendRequest_closure1.doCall(SendRequestKeyword.groovy:53)
at com.kms.katalon.core.webservice.keyword.builtin.SendRequestKeyword$_sendRequest_closure1.call(SendRequestKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:66)
at com.kms.katalon.core.webservice.keyword.builtin.SendRequestKeyword.sendRequest(SendRequestKeyword.groovy:48)
at com.kms.katalon.core.webservice.keyword.builtin.SendRequestKeyword.execute(SendRequestKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords.sendRequest(WSBuiltInKeywords.groovy:40)
at com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords$sendRequest.call(Unknown Source)
at mypackage.SampleRequestObject.buildPostApiRequestDataDriven(SampleRequestObject.groovy:110)
The other end has deliberately reset the connection. It is rare, and generally incorrect, for application software to do this, but it is not unknown for commercial software.
More commonly, it is caused by writing to a connection that the other end has already closed normally. In other words an application protocol error.
It can also be caused by closing a socket when there is unread data in the socket receive buffer.
In Windows, ‘software caused connection abort’, which is not the same as ‘connection reset’, is caused by network problems sending from your end. There’s a Microsoft knowledge base article about this.