1

``I have tried method1

 Given url urlUP + querykey
And header Authorization = auth.getBearerToken('Profile',keyClock)
And multipart file files = { read: '#(file1)' , read: '#(file2)' , read: '#(file3)' , read: '#(file4)' , contentType: 'application/json' }
When method post

Then status 200

method2

* def filepathtblBooking = 'src/test/file1.json'
* def filepathtblStatus = 'src/test/file2.json'
* def filepathtblBuilding = 'src/test/file3.json'
* def filepathtblRoom = 'src/test/file4.json'

Given url urlUP + querykey

And header Authorization = auth.getBearerToken('Profile',keyClock)

And multipart file files = { read: '#(file1)' , contentType: 'application/json' }

And multipart file files = { read: '#(file2)' , contentType: 'application/json' }

And multipart file files = { read: '#(file3)' , contentType: 'application/json' }

And multipart file files = { read: '#(file4)' , contentType: 'application/json' }

When method post Then status 200

both failed

i have tried both ways API is not hit

1 Answers1

0

Refer documentation: https://github.com/karatelabs/karate#multipart-files

And here is an example.

If you mean an array of files with the same name, we just realized this is not supported, but this will be available in the next release.

Peter Thomas
  • 54,465
  • 21
  • 84
  • 248
  • 1
    thanks so much Peter Thomas , yes we need to pass array of files with same name.... thanks so much! – Ratee Bhatt Nov 06 '22 at 04:10
  • when can we expect that .. current version is 1.4.0 from https://mvnrepository.com/artifact/com.intuit.karate/karate-core – Ratee Bhatt Nov 06 '22 at 11:12
  • @RateeBhatt could take 2 weeks for the next RC - you could build from source if you want, that will help us verify also: https://github.com/karatelabs/karate/wiki/Developer-Guide - I also think you are not referring to the files via `read()` correctly, refer: https://github.com/karatelabs/karate#path-prefixes – Peter Thomas Nov 06 '22 at 11:14