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

 

Best regards

 

Emil

  • 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!

13 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Emil91, can you post the test case structure? and some context such which step? DataGen script that you have currently?
    • Emil91's avatar
      Emil91
      Contributor

      Hiho nmrao,

       

      This is the example structure:

       

      (REST)postGeocode
      (REST)getGeocodeResult

       

      DataGen (which contain list of addresses, plenty of them there, and not every address is correct, some of them are wrong)

       

      And my idea is to set such script which in case of bad result will delete address randomly generated in DataGen from the list and continue running.

       

      If address is wrong or Map source is missing such address this is the result: 

       

      <result>
      <addresses/>
      </result>

       

      In other case result contain coordinates + full address :P

       

       

       

      And I would also be able to create list of addresses with coordinates in advance, and later if any address will trigger I want to compare it to the result, is there any chance that i can make such dataBase in soapUI? Which keep addresses and their coordinates, so i can later compare the results?:P

      • nmrao's avatar
        nmrao
        Champion Level 3
        Sorry to say, could not imagine what you are trying to achieve.
        Test case has 2 rest steps.
        Not sure where this DataGen is.
        And also I am not sure (from the DataGen ) documentation that how to loop thru that List which you are using.