How to create a loop that counts how many elements there are that have the same View Id in the screen?

Ayano

Member
I would like to do a screen read content to see what elements are in my screen and then store them in an integer variable that I will need for the loop.

Example:

If there are:
com.banana1
com.banana2
com.banana3

I want to know how many com.banana there are.

After checking in this case the integer variable will be 3.

I need this variable for the loop repeat number of times.

After the loop has run 3 times, I want to check again the screen with read content screen and if there are no more com.banana elements then continue with the macro, if there are then it has to do again the actions that will be inside the loop for those elements it found.

Then do a scroll and do the same thing again, screen content and loop.

I don't know how to count the elements with the same View Id as a dictionary.

Basically I want to, check my screen, do one thing for all the elements with the same View id that I see that I am sure will reappear, then do a scroll and do the same thing again until I see a text screen by checking true
 

Attachments

  • Tryy.macro
    51.2 KB · Views: 2
Last edited:

Dev777

Active member
Simplest method is to split the string into an array then do an array size/length
 

Attachments

  • Total_test.macro
    3.2 KB · Views: 1
Top