Forum Discussion
- faizmuhammadOccasional Contributor
you can add headers for HTTP REST or SOAP from the request. look at the bottom of your request screen there are options for it.
see highlighted part of attached image
- Optical_Image_TOccasional Contributor
IS there a script that can add it too all?
I have been doing that manually, but we have tons of test steps?
- faizmuhammadOccasional Contributor
there is an alternate way i.e. VIA groovy.
//////////////////////////
import com.eviware.soapui.support.types.StringToStringMap
def headers = new StringToStringMap()
headers.put("Header1","value123")
testRunner.testCase.getTestStepByName("HTTP Request").testRequest.setRequestHeaders(headers)///////////////////////////
in above script
Header1 is the name of header
value123 is the value of Header1
and HTTP Request is the name of test step
if you have many test step you can do multiple iteration using this code.
let me know if you need further help.