Forum Discussion

francisbrochu's avatar
francisbrochu
Occasional Contributor
8 years ago
Solved

Problem with a gotoStep in sql.eachrow

I have a Groovy script with a SQL request and I want to execute some test steps for each row. I put some log.info in each of my scripts to have a follow up. In my code just below, even if I see my lo...
  • nmrao's avatar
    8 years ago

    Looks like there are multiple goto steps in your scripts.
    It would be good to control all the steps from one step.

    Once the control goes to a particular step, it does not return to calling step back. So, better to use "run" the step like how you did in the initial part of your first script.

    If you are controlling everything from one step of the test case, depending on the sequence of the steps, there is a possibility that rest of the steps executed again once the current controlling script is completed, so it needs to be handled as well. To do this, add another groovy script, say name it as "exitScript" which only contains below statement.

    log.info "Test finished"

    In the current script (in which you are controlling running all the steps), add a last statement gotoStep for exit script so that it can skip the unwanted execution of other steps.

    Hope this is clear and helpful in your case.