Forum Discussion

Iso_Yura's avatar
Iso_Yura
Contributor
11 months ago

Data Driven Loop doesn't returns to the beginning of the test.

Hello, 

 

I can't figure out why my test doesn't start new iteration from the beginning of the test. 

I'm using csv file where I have a parameter. I expect that If statement checks the project name then depends on the name it runs one of the tests: QMZ or QHZ. But it doesn't do that way, all it does is run test then it meets first condition and run QMZ and then it starts running next keyword test QHZ instead of starting the iteration from the beginning. I marked by arrows how it should run.

 

What's wrong that it doesn't start again test from Data Driven Loop?

 

5 Replies

  • Marsha_R's avatar
    Marsha_R
    Champion Level 3

    In your diagram, you need to take everything included under your green arrow and indent it right. Then it will be included in the Data Driven Loop.

     

    You can tell what's in the loop by looking at the faint line that goes down the left. Anything you want in the loop can't be on the same level as the loop.

     

     

    • Iso_Yura's avatar
      Iso_Yura
      Contributor

      It's already in the loop. I selected everything and tried move it to the right but it doesn't let me do it.

      • Marsha_R's avatar
        Marsha_R
        Champion Level 3

        I would try the two If Then sections like this instead

         

        If ... Then

        Else

             If... Then

         

        If that doesn't work, then put some debug statements before and after each step of the two IF statements to make sure that the variables you are testing on actually contain the values you expect. You may be accidentally comparing string to number or have some other mismatch.