@Diya.3rif Need to use reources and set maximum succes number (recomended).
If you work in one thread and use loop(not recomended), you can unset Reuse recources.
Each asynchronous function started, starts in separate thread.
So in that example you will have 2 threads since 2 asynchronous functions
will be started, each with its own (different) script.
Create a variable called "counter". Than use "is element exist" to check if element exist and update "counter" variable whenever element is missing. Check counter variable in the loop, and fail thread if "counter" hit 3