TestProject Forum
Powered by leading experts in the test automation community

How to use lists in test project

Hello @ran.tzur
Suppose i have four elements on a screen with same resource-id android
can i store those four in a list and then use list elements?

Hi @ahmad,
You can build a subtest that handles the action you want to perform and increase the loop counter.
Create input and out parameters

Capture1

Add the in_index as index to the locator that match all the elements

Capture2

And add Addition Action step

Capture

Now in your test create a Test step that call the subtest and set the repeat to 4. Set the index parameter with value 1.

Capture

Capture1

@guy.saban Can we have the numbers of repeats be dynamic using a variable instead of hard coded?
Sometimes I want to go through a list and the amount of items may change and instead of having 6/10 skipped steps in my results I just want to run the step 4 times if 4 items shows up in the table.

Hi @richard1,
Currently the Step Repeats value is hard coded.

But say our list is dynamic and value is getting changed everytime, in that case to verify this scenario we need to update the hard-coded value every time