1

Method POST fails:

java.net.SocketException: An established connection has been dropped by software on your host computer, http call failed after 180865 milliseconds for url: http://localhost:8080/api/v2/files?filename=more.wav&contractId=51846706-c05f-4089-882d-7229f9b96d42
16:44:41.580 classpath:karate/features/files/files_post_exceptions.feature:106

I tried this scenario:

Scenario: As admin create file with size greater than 10MB
  * def Path = 'classpath:karate/data/more-than-10MB.wav'
  Given url HOST_V2
  And path '/files'
  And header Authorization = 'Bearer ' + TOKEN
  And header content-type = 'multipart/form-data'
  And params  {  contractId :'#(contractId)',filename : 'more-than-10MB.wav'}
  And multipart file file = {read: '#(Path)', contentType: 'application/octet-stream',filename: 'more-than-10MB.wav'}
  When method post
  Then status 500

I expect a status 500.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770
Molka
  • 21
  • 2

1 Answers1

0

Sounds like your network has throttled something. That said, Karate may have issues with large binary uploads. So you can use this workaround - which is to call curl via the command-line. Doing this for one or two "non-happy" path tests is perfectly fine (in my opinion).

Here are details: Using cURL for API automation in Karate

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248