Forum Discussion

richie's avatar
richie
Community Hero
6 years ago
Solved

JDBC Step Script Assertion To Pass MULTIPLE Instances of Same Value to Properties Step

Hi,   This is a bit complicated so I'm going to try and be really clear in my query - I apologise if I'm not.   I have a GET REST request that I'm testing that retrieves data from a database ...
  • nmrao's avatar
    6 years ago

    richie 

    That case is obvious.


    If I remember well, this was brought to discussion then. That time, it was given in the way so that you could get it going, but it was not logical because of constraint of single row as result.

    Your entire use case can be done with single groovy script(hope this was too mentioned). But that can take some time and need to be coded accordingly.

    Currently, it is limiting due to the use of Property test step (which I never prefer).

    Even with your current test steps, it should be possible to continue to use.

    1. Store the JDBC test step result (multiple rows) into csv file. Have to write the simple script.
    2. Introduce a DataSource test step right after JDBC step and read above csv file.
    3. Read each row and Assign them into Properties step (which you have already, dealing single row)
      NOTE: But not sure if OTB allows to do this. Otherwise, you may know already how to read a csv file and use those values. If this is case, it may require to adopt these changes in below step.
    4. Groovy script which is dealing with Dynamic parameters and do REST call - no change (if Properties step can hold the data from CSV)
    5. Datasource loop.

    I think you should be ok.