Feature Requests & Ideas

For bug reports and questions, please use the in-app chat or support@mabl.com.

For loop

As a test author, I want the option to enclose a set of steps/flows in a 'for' loop iterating over provided array of values or numeric range, so that I have a single source of truth for the repeated logic (therefore one place to make changes).

  • Lukas Linhart
  • Aug 8 2019
  • Shipped
  • Jan 23, 2020

    Admin response

    mabl now supports looping, which allows you to run all steps in a flow loop up to 100 times! Learn more

  • Attach files
  • Lukas Linhart commented
    24 Jan 13:06

    So, shipped.... eh... not really.

  • Lukas Linhart commented
    24 Jan 13:05

    Well, my description says "...I want the option to enclose a set of steps/flows..." pretty clearly. This implies a new construct independent of a flow (similar to if/else/end).

  • Lukas Linhart commented
    October 10, 2019 13:20

    I'd expect the for loop to resemble the one in python, please refer to the docs (the `else` clause is probably an overkill):



  • Mark Russel Cruz commented
    October 09, 2019 19:14

    Continuation on the comment:


    The reason I need the loop is, we are using this select function on different environment on different test data.


    Currently, the select option is choosing a random item inside the dropdown and we need to make sure that the selected option has items on it. The main goal is to have a reusable flow created that will select a random option in the dropdown but at the same time, we need to make sure that the selected list is not empty. Hence, we need to check/assert for the error message every time we need to randomly choose an item.

  • Mark Russel Cruz commented
    October 09, 2019 19:08

    Hi Anton. One idea that will benefit us in our automation is to implement this loop function. 


    Scenario: I have this dropdown list that has multiple options. Whenever I choose an option, there is an error message that is always displayed/triggered. It requires a couple of seconds before it disappear if the selected list return items on it. if the selected list is empty, the error will not be hidden(See screen recording in the attachment).


    I'm thinking we can have a javascript snippet that will return the number of items on the list that will be passed to the loop or we can simply set the value using a number as suggested by Lukas. 


    Having an If Statement inside this loop will be good since I can directly assert an element(error) via mabl's built in assert or with a JS snippet.  When element is verified present, it will continue with the loop. We can also just add a break statement that will stop the loop when a certain condition is met. 


    We can discuss this on a call if it's not that clear. Thanks.

  • Admin
    Anton Hristov commented
    October 08, 2019 03:08

    Can you please describe one or more scenarios for the app under test that you would like to handle with a loop? 

    This will help inform the potential design of loop capabilities in mabl.

Copyright © 2020 mabl Inc. All rights reserved.