如何发送动态多部分数据请求

时间:2019-03-19 06:52:52

标签: karate

enter image description here下面的列表显示了不同的动态多部分请求

请求_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

request1request2request3request4都具有动态的多部分wsdl文件输入。 使用空手道使其通用,以便任何数量的multipat wsdlfile都可以工作

1 个答案:

答案 0 :(得分:1)

请参见multipart files关键字,该关键字可让您处理动态文件数量的情况。