Forum Discussion

spartanhooah's avatar
spartanhooah
Occasional Contributor
7 years ago

TestSteps not executing in correct order

I have a pretty simple test case that has a Groovy driver (step 1) and one request step (step 2). The driver reads a file and runs the request step once for each line in the file. However, when I run the test case, I see the request step execute first, then the Groovy step, then the request step again (for a file with only one line).

 

If I try a file with two lines, the TestCase log reads
step 1 [request step]

step 2 [request step]

step 3 [driver step]

step 4 [request step]

 

What on earth is going on? This is v5.0.0.

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    Please show the below:
    1. screen shot of test case
    2. show groovy script
    3. what do you mean by groovy driver?
    • spartanhooah's avatar
      spartanhooah
      Occasional Contributor

      I can't show a screenshot of the test case since it might have proprietary information; same with the groovy script. I can give an example, though:

       

      TestCase:

      Groovy script step

      Request step

       

      Groovy script:

      new File(/path/to/file/).splitEachLine(',') {
          items ->
              first_part = items[0]
              second_part = items[1]
              // do some processing on the parts
              testRunner.runTestStepByName("Request step")
      }

      This script is what I mean by the groovy driver.

       

      One of my colleagues said it might be the case that the test case's log shows when a step is finished, as opposed to when it starts (which is what I thought the log showed).