Forum Discussion

richie's avatar
richie
Community Hero
8 years ago

DataLoop Not Working When Get Request Is Enabled???

Hi,

 

Ok - I have the following hierarchy

 

DataSource(Directory) with fileContents Property defined - 3 files containing data on network
POST REST step (posting ${#Datasource#fileContents} property)
Groovy Step (extracting CustRefID property from file)
Properties Step (holds CustRefID property value)
GET REST step (get request with ${#Properties#CustRefID})
Datasource Loop (loops back to POST REST step)

 

 

The Datasource Loop works fine when I disable the GET request.  i.e. I have a Datasource (directory) type that points to a directory with multiple files that contain a single line of data.  I have 3 files so the testcase executes 3 times.

 

HOWEVER - as soon as I ENABLE the GET request, the looping stops working.

 

I've moved the steps around in the hierarchy a little and I've tried changing the 'TargetStep' on the Datasource loop to anything else but it still doesn't loop according to how many datafiles are in the Datasource directory.

 

Has anyone any ideas?

 

I haven't read anything that would indicate why adding in a GET request should stop the loop working..

 

I've attached my project for clarity and a screenshot so you can see my hierarchy.

 

As with all my posts - I am very, very grateful for all/any comments/guidance/help!

 

richie

 

  • Just going through my previous posts (I have a job interview) and I came across this and I now know the answer.

     

    The test was not looping because of the failed step - disabling the test case option checkbox 'Abort test if an error occurs' was the problem.

     

    Just thought I'd update the post with the answer in case anyone else comes across this,

     

    cheers,

     

    richie

  • richie's avatar
    richie
    Community Hero

    OK - this is weird - I've discovered the problem - but I don't understand why.

     

    I had an assertion (valid http status codes, 200) specified and my GET request was failing (200 wasn't being returned).

     

    When I removed the failed assertion (leaving the assertion that passes in place) - the loop function started working.

     

    Should the loop not execute if a test step within the test case fails?

     

    Is there a setting in SoapUI where I can set the loop to continue looping despite finding a failure?  Cos if there isn't - this is going to cause me a lot of problems!

     

     

    Thanks,

     

    richie

    • richie's avatar
      richie
      Community Hero

      Just going through my previous posts (I have a job interview) and I came across this and I now know the answer.

       

      The test was not looping because of the failed step - disabling the test case option checkbox 'Abort test if an error occurs' was the problem.

       

      Just thought I'd update the post with the answer in case anyone else comes across this,

       

      cheers,

       

      richie

      • Olga_T's avatar
        Olga_T
        SmartBear Alumni (Retired)

        Hi Richie,

         

        Thanks for sharing the solution!

        And good luck with your interview :catwink: