Anupama
Anupama

Reputation: 391

How to send dynamic multipart data request

enter image description hereBelow lists shows different dynamic multipart requests

Request_1

Given url appServer
And path '/integration/rest/application/WmSOAPProvider' 
* configure charset = null
Given multipart file properties = { read: 'classpath:ic/feature/soap/TestData/soapInputWSDLData.json', filename: 'blob', contentType: 'application/json' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename1)', contentType: 'application/xml' }
And header Content-Type = 'multipart/form-data'
When method post

Request_2

Given url appServer
And path '/integration/rest/application/WmSOAPProvider' 
* configure charset = null
Given multipart file properties = { read: 'classpath:ic/feature/soap/TestData/soapInputWSDLData.json', filename: 'blob', contentType: 'application/json' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename1)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename2)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename3)', contentType: 'application/xml' }
And header Content-Type = 'multipart/form-data'
When method post

Request_3

Given url appServer
And path '/integration/rest/application/WmSOAPProvider' 
* configure charset = null
Given multipart file properties = { read: 'classpath:ic/feature/soap/TestData/soapInputWSDLData.json', filename: 'blob', contentType: 'application/json' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename1)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename2)', contentType: 'application/xml' }
And header Content-Type = 'multipart/form-data'
When method post

Request_4

Given url appServer
And path '/integration/rest/application/WmSOAPProvider' 
* configure charset = null
Given multipart file properties = { read: 'classpath:ic/feature/soap/TestData/soapInputWSDLData.json', filename: 'blob', contentType: 'application/json' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename1)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename2)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename3)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename4)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename5)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename6)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename7)', contentType: 'application/xml' }
Given multipart file wsdlFiles = { read: '#(wsdlFilesPath)', filename: '#(wsdlFilename8)', contentType: 'application/xml' }
And header Content-Type = 'multipart/form-data'
When method post

request1,request2,request3,request4 all are having dynamic multipart wsdl file input. Using Karate how to make it generic so that any number of multipat wsdlfile it should work

Upvotes: 2

Views: 579

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58058

See the multipart files keyword, that allows you to handle when the number of files is dynamic.

Upvotes: 1

Related Questions