2

[I am re-posting this; I posted it as "guest" inadvertently.]

soapUI 5.5.0, community edition.

Created REST requests with parameters (style = plain). Wanted to use them in request body as variables, but that did not work. Tried "${#firstName}" and "{firstName}"

The result was

"firstName": "",[\n]"

The call works fine with all values specified.

enter image description here

  • I think you just need to remove the quotes. But have a look at this stackoverflow.com/questions/32066042/… If you find it answers your question, please consider adding your own answer to help others in the community – ECiurleo Dec 17 '19 at 16:16
0

Steps I followed

  1. Create a new Rest project
  2. Add plain parameter to request
  3. called it in request body using ${test} (${#test} also works)
  4. Right-click the request and click 'Add to Testcase'
  5. Now run the request under test suite

enter image description here

Note:

Don't try executing the request in step 3, as a request under project does not have access to method parameters

if you want to use parameter for a request under the project and not test suite, then you have to create a custom property by clicking the project and call it as

${#Project#[propertyname]}

enter image description here

Note that you have to use #Project and not the project name

enter image description here

Note:

This has been tested with the below test API,

https://reqres.in/

THe endpoint used for testing is LOGIN - SUCCESSFUL

enter image description here

References:

https://community.smartbear.com/t5/SoapUI-Open-Source/SoapUi-getting-request-parameters/m-p/133615/highlight/true#M22780

https://www.soapui.org/scripting-properties/property-expansion.html

https://www.tutorialspoint.com/soapui/soapui_properties.htm

  • Level can be resource or method both works – PDHide Dec 18 '19 at 6:52
  • It's interesting that even when I ran the method in the non-REST test suite, it didn't work for me. The only change I can think of that caused it to work was changing RESOURCE to METHOD, but it seems unreasonable that that should have been a factor. – user42730 Dec 19 '19 at 7:08
  • @Guy could you please upvote the answer also by clicking the up arrow – PDHide Dec 19 '19 at 8:52
  • I did as you requested. It said I don't have enough rep for it to appear publicly. Thanks for your answer. – user42730 Dec 20 '19 at 9:04
  • @Guy thank you , welcome to the community – PDHide Dec 20 '19 at 9:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy