Forum Discussion

Emil91's avatar
Emil91
Contributor
7 years ago
Solved

Question about DataGen feature in soapUI NG pro

Hey guys,   I'm looking for script or idea to remove string located in DataGen -> List in case if my test step = failed, is there any chance to make it possible? Thanks in advance, cheers :P   B...
  • mpartyka's avatar
    mpartyka
    7 years ago

    Sounds like you want to read from a list of addresses (created from DataGen test step?), determine good / bad addresses from the list and then save a new list of only good addresses.  If that's correct .. this might work ? 

     

    1 - build a DATA SOURCE test step to read your list of addresses one at a time from the grid, or read them from an excel, txt 

    2  - run your REST requests & set assertions to determine if address is good / bad, using data from the DATA SOURCE test step (read into the request one row at a time each time the test loops)

    3 - GROOVY test step ...

    • if assertion is VALID for rest request then go to DATA SINK test step
    • if assertion is not VALID skip over the DATA SINK test step & go to DATA SOURCE LOOP

    4 - DATA SINK test step grab the data from the REST request / response & write to new file (this will add a row of "good addresses" for each address that has a valid assertions)

    5 - DATA SOURCE LOOP to bring you back to DATA SOURCE test step to read next entry in the list .... 

     

    Your new list of "good" addresses will be the file produced by the DATA SINK test step.

     

    Good luck!