Forum Discussion

Sjakie's avatar
Sjakie
Occasional Contributor
10 years ago

[Resolved] Order of TestSteps

Hello All,

Now I am having a strange problem. I am trying out SoapUI Pro and installed the latest version. When running my project, the order in which the teststeps are handled is different from what it should be.

I have a project that sends 2 different requests to a Mock Service. Depending on the testdata, it has to send Request_1 or Request_2 and then go to the next line of the DataSource. My testdata contains 3 testcases, 2 to send Request_1 and 1 to send Request_2. The GroovyScript check if a certain value is not null, not empty or not 0.

The project looks like this:
1. Datasource,
2. GroovyScript with Conditional Goto #1,
3. Request_1,
4. GroovyScript with Conditional Goto #2,
5. Request_2
6. DataSource Loop

The code in both Groovyscript is simple. If a certain value from the DS is null, empty or 0, do Request_1, otherwise do Request_2. The second GroovyScript does the same check, but now it goes to the DataSource Loop if no value is given from the DataSource. Otherwise just continue.

The teststeps are handled in the wrong order and I cannot see why. When running, the order is as follows:
Row#1
1. Datasource
2. Request_1
3. GroovyScript with Conditional Goto #1,
4. Request_1
5. Datasource Loop

Row#2
1. GroovyScript with Conditional Goto #2
2. Request_1
3. GroovyScript with Conditional Goto #1
4. Request_1
5. Datasource Loop

Row#3 (which meets the requirements to sent Request_2 only)
1. GroovyScript with Conditional Goto #2
2. Request_2
3. GroovyScript with Conditional Goto #1
4. Request_1
5. GroovyScript with Conditional Goto #2
6. Request_2
7. Datasource Loop

I have no idea why the order, when running, is like this. Can anyone provide any insights on this?

With kind regards,
Sjakie

@Edit:
When I disable the GroovyScripts, the order of the TestSteps is as it should be.

When I enable the second GroovyScript, the order is messed up again. Why is this?

1 Reply

  • Sjakie's avatar
    Sjakie
    Occasional Contributor
    With some help of a olleague the problem was solved. Instead of runTestStepByName I should have used gotoStepByName.

    Thanks for reading.