Forum Discussion

rclasen's avatar
rclasen
New Contributor
8 years ago

Data Driven Parameters for REST Calls That Don't Use Query Arguments

I'm a SoapUI newbie, and I'm struggling trying to create a data driven test for a REST call that includes parameters as part of the URL path instead of as a query argument.

 

The documentation and examples for data driven tests use REST calls with a query argument format (i.e., …/api/resource?parameter=value).

 

I'm trying to create a data driven test for a REST call that uses parameters as part of the URL path (i.e., …/api/resource/parameter/value).

 

I can't figure out how to define a parameter that can be driven by a data source. When I create the test case, there are no parameters shown in the Request tab's table. It says I can go to Projects to add parameters. When I do that, it just seems to append a "?parameter=value" to the end of the REST call, which doesn't work, since the call just uses the parameter value embedded in the original URL.

 

It seems like this should be real easy. Am I missing something obvious? Any help would be appreciated.

 

Note: I'm using SoapUI NG (Ready!API v1.8.5)

 

  • In Projects, when you create your REST request, have you tried setting the style of the parameter to template? See attached screenshot.

4 Replies

  • In Projects, when you create your REST request, have you tried setting the style of the parameter to template? See attached screenshot.

    • rclasen's avatar
      rclasen
      New Contributor

      Awesome, Justin.  That did the trick.  Thanks so much!!

       

      Bob

       

    • Nilesh's avatar
      Nilesh
      Occasional Contributor

      Thanks Justin! It worked for single parameter.

       

      But how can we add multiple parameters or parameter list to it?

       

      and what if I want to read parameters from text file?

      Currently I am using readline() groovy function but is there any alternate way for doing this?

      • JustinM89's avatar
        JustinM89
        Contributor

        Can you provide an example of what you're trying to do? You can add more than one request parameter, but are you trying to add multiple values to a single parameter?