Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


loop is a sequence of instructions that is continually repeated until a certain condition is reached. Some scenarios where loops are used:

  • Iterating over a list of items appearing in a drop down to validate each on

  • iterating over a set of rows in an excel sheet to fill data in a form


The action keywords for looping introduced by BQ Tool are :

...

1- for loop : While using the for loop, you just need to enter the starting and ending index and a variable name in which the counter value will be stored.

2- endFor : If you are using the for loop, you will need to end the iteration at some point. Action keyword endFor is used for ending the iteration.

The basic test script would appear as :Image Removed

...

3- breakFor : breakFor keyword will be used to break the iteration when a certain condition is reached.

The basic test script would appear as :
  

4- forEach : This keyword is used to perform a specific action for the comma separated values entered in the comma separated field of forEach keyword.

5- endForEach : If you are using the forEach loop, you will need to end the iteration at some point. Action keyword endForEach is used for ending the iteration.

The basic test script would appear as :Image Removed

...

   66- breakForEach : breakForEach keyword will be used to break the iteration when a certain condition is reached.

       The The basic test script would appear as :Image Removed

...

7- updateLoopCounter : This keyword is used to update the counter value in a loop.

    The basic test script would appear as :

   
For ex., the data in the Free Form Data Grid is as follows :Image Removed

...

The normal for loop should execute all the values one by one, if the starting index is 1 and ending index is 8.

...

The data for first row will be executed normally and the counter value will become 1.

Now updateLoopCounter keyword will be executed and the counter value will be (1 + 2) = 3

So, the data for row 3 will be executed and the counter value wil become 4.

The updateLoopCounter keyword will be executed again and the counter value will be (4 + 2) = 6

This time, the data for row 6 will be executed and the counter value wil will become 7 and the loop is continued so on.

...