Ask a Question

Trouble Getting Conditional Goto to Work Properly


Trouble Getting Conditional Goto to Work Properly

I have a test case with a conditional goto that does not behave as I expect. Below is the relevant output  from theTestCase Test Step Data Report. Step 478 correctly recognizes to transfer to UpdatePID, but the next step executing is XferPlanIdUpdatePIDtoGetPID, rather than  UpdatePID.


Step 478 [CheckUpdatePID] OK: took 4 ms
-> Matched condition [UpdatePID], transferring to [UpdatePID]
Step 479 [XferPlanIdUpdatePIDtoGetPID] FAILED: took 1 ms
-> Error performing transfer [planId] - error: Unexpected element: CDATA


Ok, so I am wondering whether part of my problem is that I am actually calling the test steps from within a groovy script (see below screenshot):  


Screen Shot 2016-01-24 at 3.20.47 PM.png


As you can see, the actual test steps as seen in the navigator are disabled, but I execute them from the groovy script Create 50 PIDs. The steps in the script execute in the same way as they would from the test case, but I needed a way to rerun the steps 50 times. My thought is perhaps executing the steps from the script is preventing the conditional goto from working properly (each step that starts with "Check" is a conditional goto). Any ideas as to what I am doing wrong or should be doing differently would be appreciated. Thank you!

SmartBear Alumni (Retired)

Hi Tclotworthy,


I suppose you get this issue because of the fact that your test steps are disabled. I would recommend that you use another approach (without using Groovy) – you can use DataSource feature to simulate running your test in a loop. Please see below of how you can do this:

  1. Enable all your test steps.
  2. Add the DataSource test step to your test as the first step.
  3. In the DataSource tab:
    1. add any property;
    2. Choose Grid in the DataSource combobox;
    3. Click Insert rows and specify how many times you want your test to be executed (50).
  4. Add the DataSource Loop step
  5. Specify the DataSource you’ve just created and your first test step in a circle (CreatePID in your case)
  6. You should get the following structure in the Navigator pane:
DataSource Loop

Does this approach work for you?

Tanya Yatskovskaya
SmartBear Community and Education Manager

Champion Level 3

May be you want to watch a video?


Thanks for the great reply Tanya.


Hmm.. However for some reason the Datasource options are disabled/greyed-out, so I can't seem to use them. Any ideas? Thanks, Tim

SmartBear Alumni (Retired)

Could you please post an image of what you see?

Tanya Yatskovskaya
SmartBear Community and Education Manager

Hi Tanya. Thanks so much for your help. I did exactly as you said and the looping using the datasource and loop steps performs as you indicated.


I am having separate issues with SoapUI having memory issues when I execute my test runs in parallel (see screenshot). This is preventing me from validating that the conditional looping is working as intented because SoapUI just hangs after awhile.


However, I want to let you know that your instructions were impecable. I am very grateful. If I can figure out my memory issues, I will respond with whether or not the conditional looping is working correctly.


Screen Shot 2016-01-25 at 8.45.21 PM.png

SmartBear Alumni (Retired)

Hi Tclotworthy,


I’m glad that my solution works for you 🙂


As for the performance issue, please try the suggestions listed in the following article:

Tanya Yatskovskaya
SmartBear Community and Education Manager

I use Ready API and changed the settings as recomended but still having issues. Sometime the data is not refreshed.For example I have groovy script which calls other project Create accounts to get the accounts in to Create Orders projct but it willnot get the latest run results.I have to restart Ready API to make it work. Now I reboot my machine every day and clean up temp files.  At least now the app is not freezing up,it used freeze often


Showing results for 
Search instead for 
Did you mean: