1

I am using Karate 0.9.5 and trying to create a testcase for following curl command.

curl -X POST \
  http://localhost:8082/v1/upload \
  -H 'content-type: multipart/form-data’\
  -H 'x-country: us' \
  -H 'x-md5: <valid MD5> ‘\
  -H 'x-userid: userName’\
  --form 'fileName="file-test.xlsx"' \
  --form 'file=@"sample.xlsx"'

Note:My file is in the same folder as in the feature file and I have given the absolute path. my other karate testcases with post calls works as expected

And my karate test is as follows and it does not works

Scenario: Testing the upload jobs
* headers file_headers
* url 'http://localhost:8082/v1/upload'
* multipart file myFile = { read:'sample.xlsx' , filename:'file-test.xlsx',contentType: 'multipart/form-data' }
* method post
* status 200
  • file-upload is impossible to solve remotely and this is based on my experience with other questions here. so I sincerely request you to first go through this exercise: https://github.com/intuit/karate/issues/1645#issuecomment-862502881 - and after that try to follow this process: https://github.com/intuit/karate/wiki/How-to-Submit-an-Issue - else you are on your own, and we are not supporting 0.9.5 any more, so please upgrade – Peter Thomas Aug 09 '21 at 09:34

0 Answers0