How to send dynamic multipart data request

别说谁变了你拦得住时间么 提交于 2019-12-11 08:44:13

问题


Below 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


回答1:


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



来源:https://stackoverflow.com/questions/55235163/how-to-send-dynamic-multipart-data-request

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!