Forum Discussion

annedemata's avatar
annedemata
New Contributor
7 years ago

Can I input the JSON raw data on the Raw tab instead of adding each key-value pair under Parameters?

I have an endpoint that supports a POST with 20 key-value pairs on the body. 

 

Is there a way to directly type raw JSON data on the "Raw" tab instead of having to add each key-value pair manually as a Parameter (and then selecting "Post QueryString")? 

 
 
 
 
  • From the SoapUI tab you can move the cursor to your Navigation window. Select the request. Your request editor window should appear on the right side. It has four tabs: request, raw, outline, and form. For request look at the "Media Type" in the window underneath. Choose "applicaiton/json" from the pull down menu.  In the space below you can type in your json

     

     

    Disclaimer: I use Groovy script for this. In my case when I run my groovy, it leaves the json in the body of the request,. In my application I don't want that after I finish the request/response. So I delete the json content in an "aftertestcase" event handler. It seems once you got your json in the window below "Media Type" it will be there for future test runs.

  • From the SoapUI tab you can move the cursor to your Navigation window. Select the request. Your request editor window should appear on the right side. It has four tabs: request, raw, outline, and form. For request look at the "Media Type" in the window underneath. Choose "applicaiton/json" from the pull down menu.  In the space below you can type in your json

     

     

    Disclaimer: I use Groovy script for this. In my case when I run my groovy, it leaves the json in the body of the request,. In my application I don't want that after I finish the request/response. So I delete the json content in an "aftertestcase" event handler. It seems once you got your json in the window below "Media Type" it will be there for future test runs.