For bug reports and questions, please use the in-app chat or email@example.com.
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).
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.
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).
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.
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.
I'd expect the for loop to resemble the one in python, please refer to the docs (the `else` clause is probably an overkill):
You won't be notified about changes to this idea.