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] | CheckUpdatePID |
Step 479 [XferPlanIdUpdatePIDtoGetPID] FAILED: took 1 ms -> Error performing transfer [planId] - error: Unexpected element: CDATA | XferPlanIdUpdatePIDtoGetPID |
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):
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!
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:
- Enable all your test steps.
- Add the DataSource test step to your test as the first step.
- In the DataSource tab:
- add any property;
- Choose Grid in the DataSource combobox;
- Click Insert rows and specify how many times you want your test to be executed (50).
- Add the DataSource Loop step
- Specify the DataSource you’ve just created and your first test step in a circle (CreatePID in your case)
- You should get the following structure in the Navigator pane:
DataSource CreatePID CheckCreatePID ….. GetPID DataSource Loop
Does this approach work for you?