We are building a new experience for our SmartBear Community.
This site is now read-only. You can still browse and search as usual. Learn More

Forum Discussion

Lschoend's avatar
Lschoend
Occasional Contributor
6 years ago
Solved

Need to pass REST parameters from a file

I have a REST API that has three parameters in the URL.

  1. http://lelvinv-mgr-test-app.itg.ti.com:8080/data/inventory/generateMaterialInventory?material=&plant=&reelCount=&reelQuantity=

I have defined the three parameters at the Resource level. I have a GET method that does not contain the parameters. My test case has three steps:

Load Parameter Properties and I have specified the file containing the properties

Set Item request which references the resource and method. Each parameter is a Query style at the Resource level

Property Transfer which transfers the response to a custom Project property

 

What's happening is that while the Load Parameter Properties step is working (the values are being set from the file) the Set Item request is failing because it says the parameters are missing. I don;t understand why the parameter values are not neing passed to the request?

 

Any help appreciated!

 

Thanks,Linda

  • nmrao's avatar
    nmrao
    6 years ago

    Lschoend 

     

    1. Like it was mentioned earlier, you don't load from properties step

    2. Please see the attached screen shot.

    - Test case has custom property DATA_FILE where you provide the property file name

    - In the setup script, use code from below script

    https://github.com/nmrao/soapUIGroovyScripts/blob/master/groovy/testCaseSetup/LoadPropertiesFromFile.groovy

    - You always run the test case (not individual test step, specially when property file content is changed)

17 Replies

  • nmrao's avatar
    nmrao
    Community Hero
    Please provide screen shots of test case, the file in which data is the and REST request step where you want to pass values. And how it is expected.
      • nmrao's avatar
        nmrao
        Community Hero

        Thanks for that.

        What type of file are you loading in step1? Is it comma separated file? Sample data would help.

        So you wanted to put the data  into Step2 as parameter values which are read from file?

        Not sure of the significance of step3.